select * from A t where (select count(1) from A where name=t.name)>1--或者select a.* from A, (select name,count(1) as cnt from A group by name) B where a.name=b.name and b.cnt>1
select * from 表A t where exists (select 1 from 表A where name=t.name and sports!=a.sports)
由于不怎么懂数据库,我用 了这句,好像也可以 select * from A WHERE name in (select name from A group by name having count(*)>1); 谢谢两位的帮助
from A t
where (select count(1) from A where name=t.name)>1--或者select a.*
from A,
(select name,count(1) as cnt from A group by name) B
where a.name=b.name and b.cnt>1
from 表A t
where exists (select 1 from 表A where name=t.name and sports!=a.sports)
select * from A WHERE name in (select name from A group by name having count(*)>1);
谢谢两位的帮助