获得同时教“物理”和“语文”的老师姓名
2014-10-25 21:42:00 访问(1826) 赞(0) 踩(0)
-
select t.TheName as '老师'
from
UTB_EXAM_TEACHER t,
(
select
t.ID
from
UTB_EXAM_TEACHER t,
(
select
sc.TeacherId,sc.CourseId
from UTB_EXAM_SCORE sc
group by sc.TeacherId,sc.CourseId
)r,
UTB_EXAM_COURSE c
where
c.ID = r.CourseId and t.ID = r.TeacherId
and
(c.TheName = '物理' or c.TheName = '语文')
group by
t.ID
having count(1) = 2
)r
where
t.ID = r.ID
标签:
获得同时教“物理”和“语文”的老师姓名 


上一条:
下一条:
相关评论
发表评论