-
慕村225694
select * from stu,(select course,MAX(mark) as maxscore from stu group by course) temp where stu.mark = temp.maxscore and stu.course= temp.course
-
饮歌长啸
这样好些,select id,name,stu.mark,stu.course from stu,( select course,MAX(mark) as maxscore from stu group by course) temp where stu.mark = temp.maxscore and stu.course= temp.course
-
慕侠2389804
SELECT id,name,MAX(mark),course FROM stu ORDER BY course
-
明月笑刀无情
应该是group by ,sql语句为: SELECT id,name,MAX(mark),course FROM stu GROUP BY course
-
浮云间
select s.* from stu s left join (select max(mark) m,course from stu GROUP BY course) c on s.mark=c.m and s.course=c.course where c.m is not null