Delete duplicate rows in database table (postgresql).

DELETE FROM in_mam WHERE ctid NOT IN (SELECT MAX(ctid) FROM in_mam GROUP BY video_id, mam_id);

mgns Over 11 years ago