标签:postgresq group font pos from _id sel sql sdn
如下:
DELETE FROM categories a WHERE ( a.id, a.name, a.parent_id ) IN ( SELECT id, name, parent_id FROM categories GROUP BY id, name, parent_id HAVING count( * ) > 1 ) AND ctid NOT IN ( SELECT min(ctid) FROM categories GROUP BY id, name, parent_id HAVING count( * ) > 1 )
关键点:oracle中有内部id为rowid, 在postgresql中有ctid.
参照:oracle rowid and postgresql ctid
标签:postgresq group font pos from _id sel sql sdn
原文地址:https://www.cnblogs.com/legendjslc/p/11785669.html