我在数据库中有三个表
- 标准
- 老师
- 课程
我想retrieve all the courses从course与一个相关联的表中specific standard.
注意 :
- 和
1 to many relationship之间有standardteacher。 - 和
1 to many relationship之间有。teachercourse - 和
no direct relationship之间有。standardcourse
我试图得到它,但无法检索数据,因为我得到的教师人数是多位的,SQL 说multiple values are not allowed。有办法吗?
这是我的查询:
select CourseName
from Course
where Course.TeacherID = (
select TeacherID
from Teacher
where StandardID = 7
)