To find and delete duplicate rows from a table, you can execute the query below. Note that this is for Oracle. You can use it for other databases but you need to change the ‘rowid’ then. delete from table_name A where a.rowid > any ( select B.rowid from table_name B where A.column_name = B.column_name ); You need to change the ‘table_name’ by your table name an the...
Sometimes, it could be handy to know in which tables a certain column name is specified. To do so, use the query below.
select distinct table_name
where column_name in ('columnA','ColumnB')
and table_schema = 'YourDatabase';
Note: you need to fill in your own column names and table_schema. Enjoy!
In this post, I will tell you how to fix the error that PostgreSQL throws when you try to execute an SQL-statement.