netnerds.net

15May/083

T-SQL: Find Duplicates Without Using JOIN

I'd forgotten about this lil trick.

select eUserName from eAttribute GROUP BY eUserName  HAVING COUNT( eUserName) > 1
Posted by: Chrissy   Filed under: SQL Server Leave a comment
Comments (3) Trackbacks (0)
  1. why not use SELECT DISTINCT?

  2. Because that does not solve the problem — I want to find duplicate records, not distinct records.


Leave a comment


No trackbacks yet.