- sum() over()(partition by ), 联想avg(),max(), min(), count()
- sum() over()(partition by order by ),联想avg(), count()
数据表:
名为GRADE 的表格,记录学生id, 学生多次考试成绩score, 考试日期dt等数据
id | dt | score |
---|---|---|
1 | 2019-05-01 | 100 |
… | … | … |
1. sum() over()(partition by ) :
- 分组列表,属于同一id的每条数据总成绩相同:
select id,score,
sum(score) over(patition by id