[SQL] Remove duplicate records
Here’s an example of deleting records in postgresql
delete from product c1 using product c2 where c1.id < c2.id and c1.name = c2.name
Here’s an example of deleting records in postgresql
delete from product c1 using product c2 where c1.id < c2.id and c1.name = c2.name
This is a note of how to create a read-only user in Postgresql database. First, connect to the database by super user. Run this command to create an user and assign read-only to that user Example Example of revoke and drop users Revoke and drop users
Insert statement ON CONFLICT (columns) DO NOTHING; References