I have an sql server database, that I pre-loaded with a ton of rows of data.
Unfortunately, there is no primary key in the database, and there is now duplicate informati
Let's say your table is unique by COL1 and COL2. Here is a way to do it:
SELECT * FROM (SELECT COL1, COL2, ROW_NUMBER() OVER (PARTITION BY COL1, COL2 ORDER BY COL1, COL2 ASC) AS ROWID FROM TABLE_NAME )T WHERE T.ROWID > 1
The ROWID > 1 will enable you to select only the duplicated rows.