with t as (
select id,uid,name,count(id) over (partition by userlist.id) r from userlist
)
select * from t where r>1

 

如果要查询不重复的记录则 

with t as (
select id,uid,name,rank() over (partition by userlist.id order by userlist.id desc) r from userlist
)
select * from t where r=1 

 

posted on 2011-07-29 11:23  袁晓平  阅读(141)  评论(0编辑  收藏  举报