I have created a table Emp_Salary
Create Table Employee_Salary
and inserted some records into the table. Some of them are duplicate records. Now, I want to remove all the duplicate records present in the table.The query I wrote was:
Delete from Employee_Salary
WHERE EXISTS (select FirstName,COUNT(FirstName) from Employee_Salary
GROUP BY FirstName
HAving COUNT(FirstName) > 1)
But this is deleting all the records from the table..How can we just delete the duplicate records only?