Check duplicate count based on 3 columns combo
select EMPID,FORMinfoID,FormName,Count(*) as counts from tbl_FilesMigrationLogs
group by EmpID,FormInfoID,FormName
HAVING COUNT(*) >1;
WITH CTE AS (
SELECT EMPID,FORMinfoID,FormName,
ROW_NUMBER() OVER (PARTITION BY EmpID, FormInfoID,FormName ORDER BY EMPID) AS rn
FROM tbl_FilesMigrationLogs
)
Select * FROM CTE WHERE rn > 1;
but for the both quries getting count different..
but for the both quries getting count different..
No comments:
Post a Comment