Frage im Vorstellungsgespräch bei Cognizant

How to delete duplicate rows in sql

Antwort im Vorstellungsgespräch

Anonym

10. Okt. 2018

First try to find the count of duplicate rows and then delete it except one record. with Emp as ( select *, row_number()over(partition by ID order by ID) as rowcount from Employee ) Delete from Emp where rowcount>1