需要sql查询根据键对值求和并从中找出最大值吗?示例:rollno、name、class、marks。我需要每个班级的最高分数?
92dk7w1h1#
试试这个:
Select Name, Class, max(Max_Marks) From ( Select RollNo, Name, CLass, max(Marks) [Max_Marks] From YourTable Group By Class, Name, RollNo ) Group By Name, Class
1条答案
按热度按时间92dk7w1h1#
试试这个: