select t.* from a t where exists(select 1 from (select xm,sfzhm from a group by xm, sfzhm having count(1) >= 2) m where m.xm = t.xm and m.sfzhm = t.sfzhm) order by t.xm , t.sfzhm
select * from table_name a,table_name b where a.xm = b.sfzhm
лл2Â¥£¬ÎÒÒªµÄ¾ÍÊÇÕâÖÖ½á¹û£¬ÓÉÓÚÎÒ¸Õѧoracle,Òò´Ë»¹Çë½âÊÍÏÂÕâÌõÓï¾ä£¬ select 1 from (select xm,sfzhm from a group by xm, sfzhm having count(1) >= 2) m where m.xm = t.xm and m.sfzhm = t.sfzhm£¬ÕâÌõÓï¾äÓе㸴ÔÓ£¬Çë½âÊÍÏ£¬Ð»Ð»¡£ ÁíÍâÄÜ·ñʹ²éѯËٶȸü¿ìµã£¿