1

Suppose multiple column with 1000 records in a table, how to find the duplicate record in whole table?

Please help.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Tawheed
  • 31
  • 4

1 Answers1

1

Duplicated id's:

select s.id, t.* 
from [stuff] s
join (
    select name, city, count(*) as qty
    from [stuff]
    group by name, city
    having count(*) > 1
) t on s.name = t.name and s.city = t.city     

answer is also posted in this topic: How do I find duplicates across multiple columns?

Community
  • 1
  • 1