题目是用子查询查询成绩不及格的设计MySchool数据库课程的学生学号,姓名
select StudentNo,StudentName,GradeId
from Student
where GradeId=(
select GradeID
from Subject
where SubjectName='设计MySchool数据库' and SubjectID in(
select SubjectID
from Result
where StudentResult<60
)
)
select StudentNo,StudentName,GradeID
from Student
where StudentNo in(
select StudentNo
from Result
where StudentResult<60 and SubjectID =(
select SubjectID
from Subject
where SubjectName='设计MySchool数据库'
)
)
为什么条件倒换一下答案就错了,
下面的一段代码是对的
慕桂英2170621
慕桂英2170621
慕桂英2170621
相关分类