pgsql指定部分字段去重

-- 基于ig.start_pile,ig.end_pile 字段去重
with ete as ( SELECT * from (SELECT ROW_NUMBER() OVER(PARTITION by ig.start_pile,ig.end_pile ORDER BY ig.start_pile  asc )idx,ig.*
from image_straight ig
) ord where ord.idx = 1 
)
SELECT * from ete limit 1

  

posted @ 2022-10-28 11:25  懂得归零  阅读(1069)  评论(0编辑  收藏  举报