去重复的sql(Oracle)

1.利用group by 去重复

2.可以利用下面的sql去重复,如下

  1) select id,name,sex from (select a.*,row_number() over(partition by a.id,a.set order by name) su from test a ) where su=1

  2)select id,name,sex from (select a.*,row_number() over(partition by a.id,a.sex order by name) su from test a) where su>1

posted @ 2018-10-11 09:45  梦浍烈风灵  阅读(691)  评论(0编辑  收藏  举报