WITH cte AS (
SELECT roleid,permissionid,
row_number() OVER(PARTITION BY roleid,permissionid
ORDER BY roleid,permissionid) AS [rn]
FROM rolepermissionrecords
)
DELETE cte WHERE [rn] > 1
2023-10-29 16:13:04
WITH cte AS (
SELECT roleid,permissionid,
row_number() OVER(PARTITION BY roleid,permissionid
ORDER BY roleid,permissionid) AS [rn]
FROM rolepermissionrecords
)
DELETE cte WHERE [rn] > 1