查询有二门以上(含两门)不及格课程的学生姓名及其总成绩。
select sname,sum(grade) sumgrade
from student,sc
group by sname
where count(sno)>student.sno in (select sno from sc where grade<60) 服务器: 消息 156,级别 15,状态 1,行 4
在关键字 'where' 附近有语法错误。
select sname,sum(grade) sumgrade
from student,sc
group by sname
where count(sno)>student.sno in (select sno from sc where grade<60) 服务器: 消息 156,级别 15,状态 1,行 4
在关键字 'where' 附近有语法错误。
from student,sc
group by sname
where student.sno in (select sno from sc where grade<60)
having sum(case when grade <60 then 1 else 0 )>1
having sum(case when grade <60 then 1 else 0 )> 1
from student,sc
where student.sno in (select sno
from sc
where grade<60
group by sno
having count(*)>1)
group by sname
from student,sc
where student.sno=sc.sno and student.sno in (select sno
from sc
where grade<60
group by sno
having count(*)>1)
group by sname