一个SQL完成恐怕不好写吧,可以建个临时表tmpname,里面只有一个name字段,然后:
insert into tmpname(name) select name from nowtable group by name having count(*)>1;
然后:select nowtable.* from nowtable,tmpname where nowtable.name=tmpname.name;
即得结果,nowtable是你要查的表。
insert into tmpname(name) select name from nowtable group by name having count(*)>1;
然后:select nowtable.* from nowtable,tmpname where nowtable.name=tmpname.name;
即得结果,nowtable是你要查的表。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货