Mysql中表student_table(id,name,birth,sex),score_table(stu_id,subject_name,score),查询多个学科的总分最高的学生记录明细以及总分,如下SQL正确的是()?
select t2.*,c1 as `最高分` from (
select stu_id,sum(score) as c1 from score_table group by stu_id order by c1 desc limit 1
) t1
join student_table t2
on t1.stu_id = t2.id ;
select t2.*,c1 as `最高分` from (
select stu_id,max(score) as c1 from score_table group by stu_id order by c1 desc limit 1
) t1
join student_table t2
on t1.stu_id = t2.id ;
select t2.*,c1 as `最高分` from (
select stu_id,max(sum(score)) as c1 from score_table group by stu_id order by c1 desc limit 1
) t1
join student_table t2
on t1.stu_id = t2.id ;
select t2.*,c1 as `最高分` from (
select stu_id,max(sum(score)) as c1 from score_table group by stu_id
) t1
join student_table t2
on t1.stu_id = t2.id ;