1. 程式人生 > >PostgreSQL 剔除表中重複資料

PostgreSQL 剔除表中重複資料

如何簡單有效的剔除資料表中重複的冗餘資料呢?

select 
    * 
from 
    [表名] 
where 
    objectid in (
        select 
            max(objectid) 
        from 
            [表名] 
        group by 
            userid,createdate
    ) 
    and other option