你把A的别名小a改为其它字母就可以了select * from A aaaa where exists (select name from A where name=aaaa.name group by name having count(*)>1)
select * from A aa where (select count(*) from A where name=aa.name)>1 --或者: select a.* from A join(select name from A group by name having count(*)>1) b on a.name=b.name
select * from A a where exists (select b.name from A b where b.name=a.name group by b.name having count(*)>1)
select * from A a where exists (select b.name from A b where b.name=a.name group by b.name having count(*)>1)
where exists (select name from A where name=aaaa.name group by name having count(*)>1)
select * from A aa
where (select count(*) from A where name=aa.name)>1
--或者:
select a.* from A join(select name from A group by name having count(*)>1) b on a.name=b.name
where exists (select b.name from A b where b.name=a.name group by b.name having count(*)>1)
where exists (select b.name from A b where b.name=a.name group by b.name having count(*)>1)