根据某一个字段重复只取第一条数据

select s.*  
from (
    select *, row_number() over (partition by [手机号] order by [店铺]) as group_idx  
    from table_name
) s
where s.group_idx = 1

 

posted @ 2017-09-29 10:01  爛轲  阅读(844)  评论(0)    收藏  举报