WITH QueryTable AS (
SELECT RN = ROW_NUMBER() OVER (PARTITION BY salary ORDER BY salary )
, salary
, userid
FROM emp where salary<>''
)
select * FROM QueryTable WHERE RN > 1
or
delete FROM QueryTable WHERE RN > 1
SELECT RN = ROW_NUMBER() OVER (PARTITION BY salary ORDER BY salary )
, salary
, userid
FROM emp where salary<>''
)
select * FROM QueryTable WHERE RN > 1
or
delete FROM QueryTable WHERE RN > 1
No comments:
Post a Comment