PostgreSQL : How to delete duplicate rows using WITH clause

preview_player
Показать описание
Delete duplicate records from the table if the table does not have a primary key using WITH clause
Рекомендации по теме
Комментарии
Автор

Whenever i run single querry two times it creates duplicate rows is there any solution of this

jaibabaki
Автор

I don't understand the part where you used (delete from tab_data returning*) then insert into tab_data(user_name, gender)... did you mean you deleted them first then return them in to the table?

Mori-Chan