sql 数据库怎样查询某一列下相同的值

2024-11-30 02:59:10
推荐回答(5个)
回答1:

select id, name
from studentInfo t1
where exists(select 1 from studentInfo where name = t1.name and id <> t1.id)

回答2:

这个不难呀,可以这样嘛,select id,name from studentinfo where name='张三';

回答3:

select id,name from studentInfo
where name in (select name from studentInfo group by name having count(name)>1)

回答4:

select id,name
from studentInfo
group by name having count(name)>1

回答5:

select id,name from studentInfo where name='张三';