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