select id, name
from studentInfo t1
where exists(select 1 from studentInfo where name = t1.name and id <> t1.id)
这个不难呀,可以这样嘛,select id,name from studentinfo where name='张三';
select id,name from studentInfo
where name in (select name from studentInfo group by name having count(name)>1)
select id,name
from studentInfo
group by name having count(name)>1
select id,name from studentInfo where name='张三';