获得“物理”考试最高分的学生

2014-10-25 21:56:41  访问(1970) 赞(0) 踩(0)

  • 考虑多个学生记录的情况

  • select 
    s.TheName as '姓名',sc.Score as '成绩'
    from
    UTB_EXAM_STUDENT s,
    UTB_EXAM_SCORE sc,
    UTB_EXAM_COURSE c,
    (
    select 
    max(sc.Score) as MaxScore,sc.CourseId
    from
    UTB_EXAM_SCORE sc
    group by sc.CourseId
    )r
    where
    s.ID = sc.StudentId
    and sc.Score = r.MaxScore 
    and sc.CourseId = c.ID
    and r.CourseId = c.ID
    and c.TheName = '物理' 
    
    

标签:获得“物理”考试最高分的学生 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)