获得总分最高的学生姓名和总分
2014-10-25 22:24:30 访问(1880) 赞(0) 踩(0)
-
select
s.TheName as '姓名',
r3.TotolScore as '总分'
from
UTB_EXAM_STUDENT s,
(
select r2.* from
(
select
max(TotolScore) as maxScore
from
(
select sum(sc.score) as TotolScore
from
UTB_EXAM_SCORE sc
group by StudentId
)r
)r1,
(
select sc.StudentId,sum(sc.score) as TotolScore
from
UTB_EXAM_SCORE sc
group by StudentId
)r2
where
r1.maxScore = r2.TotolScore
)r3
where
s.ID = r3.StudentId
标签:
获得总分最高的学生姓名和总分 


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