You could add a sub query to your select statement, using EXISTS (or rather, NOT EXISTS) to check for the article.
How you determine whether two articles are the "same" is up to you to decide of course, but say for example that your criteria was the titles being the same. Then you'd modify your query to read:
Code:
INSERT INTO ltw_feature f1 ( 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
FROM ltw_articles
INNER Join ltw_authors
On ltw_articles.authorID = ltw_authors.authorref
WHERE NOT EXISTS (SELECT title FROM ltw_feature f2 WHERE f2.title = ltw_articles.title)
ORDER BY newid()
So the query will now only get records where there isn't already a feature with the same title.
Hope that helps
.
Bookmarks