11 February 2014

Delete duplicate records from the table in SQL Server

delete from testtable where id not in (select min(id) from testtable group by dept, name)

No comments:

Post a Comment