获得每个科目的名称,考试人数,最高分,最低分和平均分

2014-10-25 21:21:45  访问(1727) 赞(0) 踩(0)

  • select c.TheName,r.CountValue as '考试人数',
    r.MaxValue as '最高分', r.MinValue as '最低分',r.AvgValue as '平均分'
    from
    (
    select c.ID, count(sc.ID) as countValue, 
    max(sc.score) as maxValue,min(sc.score) as MinValue,avg(sc.score) as AvgValue  
    from   
    UTB_EXAM_COURSE c,  
    UTB_EXAM_SCORE sc  
    where  
    c.ID = sc.CourseId 
    group by c.ID
    )r,
    UTB_EXAM_COURSE c
    where 
    c.ID = r.ID
    order by c.TheName
    

标签:获得每个科目的名称,考试人数,最高分,最低分和平均分 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)