窗口函数的应用
根据题意,对number按照grade累加
sum(number)over(order by grade)
这就是t_rank
所以结果为
select grade, sum(number) over(order by grade) t_rank from class_grade order by grade
窗口函数的应用
根据题意,对number按照grade累加
sum(number)over(order by grade)
这就是t_rank
所以结果为
select grade, sum(number) over(order by grade) t_rank from class_grade order by grade