Selecting Duplicate Rows in A Table….
August 15, 2007
I knew this before but couldnt recall it when I needed it…. so I am posting it here……(credit goes to vhikida@inreach.com )
Problem :
TABLE_A has columns x and y. You want to select duplicate rows from that table
Solution :
select * from TABLE_A where (x,y) IN (SELECT x, y FROM TABLE_A m2 GROUP BY x,y HAVING COUNT(*) > 1)