select 姓名 from
(select * from
( select a.学生编号,a.姓名
b. 学生编号,b.科目,b.分数
from table1 a right join table2 b
on b.学生编号=a.学生编号
)c
group by c.科目
having max(c.分数) )
select t1.姓名,t2.分数
from table1 t1,
(select max(分数)as 分数,学生编号 from table2 group by 学生编号) t2
where t1.学生编号=t2.学生编号