How to exclude all duplicates from select query
Hello, I am trying to execute a query where it will ignore all duplicates and return the rest. (not just return the one entry of the duplicate with using the distinct expression) Ie) The field "id" is supposed to have only unique id's. However, there are duplications which aren't meant to be there at all. I can think finding the duplications and removing the data sets from the table but I don't wish to do so because the duplication data is meant to be there. Here's an example id 1 1 2 3 4 5 5 The desired output of the query would be id 2 3 4 Thanks in advance!
April 29th, 2011 12:50am

Use this: select * fromtesttable where id not in (select id from testtable group by id having COUNT(*) >1 ) Cheers Sunil Gure
Free Windows Admin Tool Kit Click here and download it now
April 29th, 2011 1:07am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics