1个字段重复:

select   *   from   emp 

    where name   in   (select   name   from   emp group   by   name having count(*)>1)

 

多个字段重复:

select *
from table1 a
where exists (select *
from (select xm, ag
from table1
group by xm, ag
having count(*) > 1) b
where b.xm = a.xm
and b.ag= a.ag)
posted on 2013-07-09 10:53  清风暮雨  阅读(498)  评论(0)    收藏  举报