Thursday, September 14, 2006

Eliminating Dupes and still getting IDs

http://www.devx.com/getHelpOn/10MinuteSolution/16597/1954?pf=true

If you want to eliminate duplicates while still retaining the ID of a record, do this:

select min(questionid), questiontext
from questions
group by questiontext

If two questions have the same text, this query will only return the first.