日期:2014-05-17 浏览次数:20842 次
select Score.StudentID, Score.Result from (select StudentID from Score where Result > 60) StuAbove60, Teach, Score where StuAbove60.StudentID = Teach.StudentID and Score.StudentID = Teach.ManagerID;
------解决方案--------------------
成绩Result大于60分的应该不止一个吧 然后对应的也不止一个班主任咯?
select StudentID,Result from Score where StudentID in (select ManagerID from Teach t1 where t1.StudentID in (select StudentID from Score where Result<60) )