Code Snippet posted by:
Sabarimahesh | Posted on: 5/8/2012 | Category:
SQL Server Codes | Views: 506 | Status:
[Member] |
Points: 40
|
Alert Moderator
To Find
WITH Temporary_table (Empid,Sub_id, Count_Duplicate)
AS
(
SELECT Empid,Sub_id,ROW_NUMBER() OVER(PARTITION BY Empid,Sub_id ORDER BY Empid) AS Count_Duplicate FROM Emp_table
)
To Eliminate
DELETE FROM Temporary_table WHERE Count_Duplicate > 1
Life is a Race
Thanks & Regards
By
Sabari Mahesh P M
Found interesting? Add this to: