如何用sql 查找两个字段重复的记录,并列出重复记录

如题所述

如何用sql 查找两个字段重复的记录,并列出重复记录
select *
from shiyan003 a
where exists (select 1
from (select xm, sfzhm
from shiyan003
group by xm, sfzhm
having count(*) > 1) s
where s.xm = a.xm
and s.sfzhm = a.sfzhm)
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答