sql根据某一个字段重复只取第一条数据
时间:2021-09-07 16:25:07
收藏:0
阅读:41
select s.* from ( select *, row_number() over (partition by 指定按哪些字段进行分组,这些字段值相同的记录将在一起编号 order by则是指定在同一组中进行编号时是按照怎样的顺序) as group_idx from table_name) swhere s.group_idx = 1原文:https://www.cnblogs.com/ztjboke/p/15236960.html
评论(0)