用SQL语言,查询选修了两门以上课程的学生号和姓名?
有三个表,student(sno,name,sex,birthday,class),course(cno,cname,tno)score(sno,cno,degree)...
有三个表,student(sno,name,sex,birthday,class),
course(cno,cname,tno)
score(sno,cno,degree) 展开
course(cno,cname,tno)
score(sno,cno,degree) 展开
2个回答
展开全部
select s.sno,s.name from student s
where s.sno in(select sno from score sc
group by sc.cno having sum(sc.sno)>2
where s.sno in(select sno from score sc
group by sc.cno having sum(sc.sno)>2
追问
我试了一下,好像有点语法错误哦.
追答
select s.sno,s.name from student s
where s.sno in(select sno from score sc
group by sc.cno having sum(sc.sno)>2 ) 最后漏掉了一个右括号。。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询