Below SQL queries will helpful to remove duplicate values from sql table:
1.
DELETE FROM table WHERE ID IN (
SELECT
ID, COUNT(ID)
FROM table
GROUP BY ID
HAVING
COUNT (ID) > 1);
2.
Delete from [master].[dbo].[EMP] where EMP_ID not in (
SELECT MAX(EMP_ID) AS MaxRecordID
FROM [master].[dbo].[EMP]
GROUP BY emp_name,
EMP_SALARY )
0 Comments
If you have any queries, please let me know. Thanks.