Link to home
Start Free TrialLog in
Avatar of Stefan Motz
Stefan MotzFlag for United States of America

asked on

Delete duplicates from SQL Server table

Hi Experts,
I'd like to delete duplicates from a SQL Server table. This is the query to show the duplicates:

SELECT Emp_Id, COUNT(Emp_Id) FROM TrainingLocal Where CourseId='164' GROUP BY Emp_Id HAVING COUNT(Emp_Id)>1

Would you please help me write a query that deletes the duplicates from this table?
I would really appreciate your help
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Stefan Motz

ASKER

Thank you so much, this is perfect!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You're welcome!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you everyone for your quick and helpful responses!