Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Selecting duplicate records

Author  Topic 

mnolting
Starting Member

36 Posts

Posted - 2007-06-28 : 16:38:49
Is there a way to see a list of duplicate records??
EG There is a field named "Invoice" in a table named "Orders" and I want to see only records where the same invoice shows more than once.

Sample output:

Invoice--Partno
123------a66
123------9pp
123------k33
5988-----j22
5988-----bx1
66-------pq1
66-------333

etc......

Thanks
Mike

hey001us
Posting Yak Master

185 Posts

Posted - 2007-06-28 : 16:46:33
SELECT invoice FROM orders
GROUP BY invoice HAVING COUNT(invoice) > 1

hey
Go to Top of Page
   

- Advertisement -