Find and Delete Duplicate Records
راهله شاکری | سه شنبه, ۱۲ اسفند ۱۳۹۹، ۰۸:۳۴ ق.ظ |
۰ نظر
SELECT session_user, db_unique_name, count(*)
FROM p2.acl
GROUP BY session_user, db_unique_name
HAVING count(*) > 1;
DELETE p2.acl
WHERE db_unique_name = 'NIRVAN'
AND rowid NOT IN (SELECT min (rowid)
FROM p2.acl
WHERE db_unique_name = 'NIRVAN'
GROUP BY session_user, db_unique_name);