Ameriprise interview question

How to get duplicate data from a table and delete those duplicate records

Interview Answers

Anonymous

5 Feb 2018

Delete from tablename where rowid not in (select max(rowid) from tabname groupby colname) Colname in groupby will be a primary key column

1

Anonymous

12 Aug 2018

Delete from tablename where rowid not in (select min (rowid) from tabname groupby colname)