列出每个班每个科目的最高分

2014-10-25 22:25:53  访问(2424) 赞(0) 踩(0)

  • 
    
    select 
    c.TheName as '班级',
    co.TheName as '科目',
    r2.maxScore as '最高分'
    from
    UTB_EXAM_CLASS c,
    UTB_EXAM_COURSE co,
    (
    	select 
    	r.CourseId,r.ClassId,max(r.Score) as maxScore
    	from 
    	(
    		select
    		sc.*,s.ClassId
    		from
    		UTB_EXAM_SCORE sc,
    		UTB_EXAM_STUDENT s
    		where
    		sc.StudentId = s.ID
    	)r
    	group by
    	r.CourseId,r.ClassId
    )r2
    where
    c.ID = r2.ClassId
    and co.ID = r2.CourseId
    order by c.ID,co.ID
    
    

标签:列出每个班每个科目的最高分 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)
 
  ┈全部┈  
 
(显示默认分类)