magritton
9/24/2015 - 1:18 AM

SQL query to find the duplicates in a table using a single values.

SQL query to find the duplicates in a table using a single values.

SELECT    t.TableName,t.FieldName, COUNT(t.TableName) AS dup_count 
FROM         MLTableRaw t
GROUP BY t.TableName,t.FieldName
HAVING     (COUNT(t.TableName) > 1) 
SELECT    t.RowHash, COUNT(t.RowHash) AS dup_count 
FROM         sym.dimTransactions t
GROUP BY t.RowHash
HAVING     (COUNT(t.RowHash) > 1)