the mother of all queries
I have this query for MS SQL that is supposed to query the master table of articles and insert the 'feature' article into a new table.[vbs]
INSERT INTO ltw_feature ( title, article, source, url, Author, bio, authorurl, authorurl2 )
SELECT TOP 1 ltw_articles.title, ltw_articles.content, ltw_articles.sourcename, ltw_articles.sourceURL, ltw_authors.aname, ltw_authors.bio, ltw_authors.authorURL, ltw_authors.authorURL2
INNER JOIN ltw_authors
ON ltw_articles.authorID = ltw_authors.authorref ORDER BY newid()[/vbs]
Now my problem is, is that I don't know how to make sure that the same article hasn't already been previously entered into the db. Any way to limit what gets selected to articles NOT already in the feature article table?