Removing duplicate rows in PostgreSQL, Oracle and SQLite

Sometimes you need to remove nasty duplicate on a table, based on a subset of the column.

Oracle trick:

Postgresql equivalent is ctid, so you can try something like

SQLite demo:


Also take a look at this old post on postgresql mailing list, if you incur in an older PostgreSQL version

Rev history
Added SQLITE on August 26th 2019
Published on Jun 16,2017