表student结构如下:求每个学生分数最高的科目及分数。
SQL:
select s.* from (select *,row_number() over (partition by name order by score desc) as rownumber from [COMMON].[dbo].[student]) s where s.rownumber=1;
查询结果:
Copyright @ Jakin.zhou Powered by: .Text and ASP.NET Theme by: .NET Monster