成绩表Score(学号,姓名,课程号,成绩)
13 个解决方案
#1
SELECT
学号
FROM tb
WHERE 成绩>90
GROUP BY 学号
HAVING COUNT(DISTINCT 课程号)>=2
#2
select 学号
from tablename
where 成绩>90
group by 学号
HAVING COUNT(1)>=2
from tablename
where 成绩>90
group by 学号
HAVING COUNT(1)>=2
#3
select xuehao
from tb
group by xuehao
having count(case when chengji>90 then 1)>2
#4
select xuehao
from Score
where chengji>90
group by kechenghao
having count(1)>=2
#5
这个好,我的错了。
#6
select 学号 from Score where 成绩>90 having count(学号)>=2
#7
select 学号 from Score where 成绩>90 having count(学号) >= 2
#8
select 学号,count(*)
from score
where 成绩>90
group by 学号
HAVING COUNT(*)>=2;
from score
where 成绩>90
group by 学号
HAVING COUNT(*)>=2;
#9
select xuehao
from Score
where chengji>90
group by kechenghao
having count(1)>=2
#10
已有正解
#11
select distinct sno from Table_2
where score>=90
group by sno
having count(*)>=2
#12
1楼 似乎对了!
#13
SELECT
学号
FROM tb
WHERE 成绩>90
GROUP BY 学号
HAVING COUNT(DISTINCT 课程号)>=2
学号
FROM tb
WHERE 成绩>90
GROUP BY 学号
HAVING COUNT(DISTINCT 课程号)>=2
#1
SELECT
学号
FROM tb
WHERE 成绩>90
GROUP BY 学号
HAVING COUNT(DISTINCT 课程号)>=2
#2
select 学号
from tablename
where 成绩>90
group by 学号
HAVING COUNT(1)>=2
from tablename
where 成绩>90
group by 学号
HAVING COUNT(1)>=2
#3
select xuehao
from tb
group by xuehao
having count(case when chengji>90 then 1)>2
#4
select xuehao
from Score
where chengji>90
group by kechenghao
having count(1)>=2
#5
这个好,我的错了。
#6
select 学号 from Score where 成绩>90 having count(学号)>=2
#7
select 学号 from Score where 成绩>90 having count(学号) >= 2
#8
select 学号,count(*)
from score
where 成绩>90
group by 学号
HAVING COUNT(*)>=2;
from score
where 成绩>90
group by 学号
HAVING COUNT(*)>=2;
#9
select xuehao
from Score
where chengji>90
group by kechenghao
having count(1)>=2
#10
已有正解
#11
select distinct sno from Table_2
where score>=90
group by sno
having count(*)>=2
#12
1楼 似乎对了!
#13
SELECT
学号
FROM tb
WHERE 成绩>90
GROUP BY 学号
HAVING COUNT(DISTINCT 课程号)>=2
学号
FROM tb
WHERE 成绩>90
GROUP BY 学号
HAVING COUNT(DISTINCT 课程号)>=2