Cuma, Aralık 20, 2013

how to find postgresql duplicate records

SELECT * FROM (
SELECT id,
codename,
ROW_NUMBER() OVER(PARTITION BY name, codename ORDER BY id asc) AS count
FROM auth_permission
) dups
WHERE
dups.count > 1

Hiç yorum yok: