SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
WITH RankedDuplicates AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY unique_column ORDER BY id) AS rn FROM table_name ) DELETE FROM RankedDuplicates WHERE rn > 1; -- Оставляем только одну строку из каждой группы дубликатов [2](https://sky.pro/wiki/sql/udalenie-dublikatov-strok-v-postgre-sql-sql-komanda/)

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear