1. 程式人生 > >PostgreSQL快速刪除重複記錄

PostgreSQL快速刪除重複記錄

delete from public."YH_XQ" 
where ctid =ANY(ARRAY(select ctid 
from (select row_number()over(PARTITION BY lj_id),ctid from public."YH_XQ") x where x.row_number>1))