WITH TempEmp (class_id,user_id,Counter)
AS
(
SELECT class_id,user_id,ROW_NUMBER() OVER(PARTITION by class_id, user_id ORDER
BY user_id)
AS Counter
FROM user_class
)
--Now Delete
Duplicate Records
--select * from TempEmp where Counter > 1
DELETE FROM TempEmp
WHERE Counter > 1
No comments:
Post a Comment