T-SQL: Find Duplicates Without Using JOIN

Filed under: SQL Server — Written by Chrissy on Thursday, May 15th, 2008 @ 12:34 pm

I'd forgotten about this lil trick.

select eUserName from eAttribute GROUP BY eUserName  HAVING COUNT( eUserName) > 1
2 Comments   -
  • Comment by LaptopHeaven | May 15, 2008 @ 7:01 pm

    why not use SELECT DISTINCT?

  • Comment by Chrissy | June 9, 2008 @ 3:56 pm

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

Leave your comment