PostgreSQL Removing duplicates

后端 未结 4 1747
不思量自难忘°
不思量自难忘° 2021-01-18 12:33

I am working on postgres query to remove duplicates from a table. The following table is dynamically generated and I want to write a select query which will remove the recor

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-18 12:54

    So basically I did this

     create temp t1 as 
     select first, min (second) as second
     from df1 
     group by first
    
     select * from df1 
     inner join t1 on t1.first = df1.first and t1.second = df1.second
    

    Its a satisfactory answer. Thanks for your help @Hack-R

提交回复
热议问题