I have a table with a varchar column, and I would like to find all the records that have duplicate values in this column. What is the best query I can use to find the duplic
Assuming your table is named TableABC and the column which you want is Col and the primary key to T1 is Key.
SELECT a.Key, b.Key, a.Col FROM TableABC a, TableABC b WHERE a.Col = b.Col AND a.Key <> b.Key
The advantage of this approach over the above answer is it gives the Key.