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

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  爛轲  阅读(828)  评论(0编辑  收藏  举报