Skip to main content

Posts

Showing posts from June, 2016

How to find duplicate records in a table?

How to find the duplicate records in a table? Query: Simple Table SELECT c1, c2, ... ,cn, count(*) FROM TableName GROUP BY c1, c2,..., cn HAVING count(*) > 1; Table with Joins: SELECT c1, c2, ... ,cn, count(*) FROM TableName1 INNER JOIN TableName2 on TableName1.ColName=TableName2.ColName GROUP BY c1, c2,..., cn HAVING count(*) > 1;