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)
Login to post response