first_value 用法:
select id, money, first_value(money) over(partition by id order by money) from winfunc;
id money first_value_window_0 1001 100 100 1001 150 100 1001 150 100 1001 200 100 1002 50 50 1002 100 50 1002 200 50 1002 200 50 1002 300 50 1002 400 50 1003 50 50 1003 400 50 1004 60 60
SUM 开窗函数用法:
select id, money, sum(money) over (partition by id order by money) from winfunc; 缺window frame子句,range between unbounded precending and current row是默认值,因此本查询语句等于 标签:150,函数,money,50,HIVE,开窗,100,1002,1001 From: https://www.cnblogs.com/pengpenghuhu/p/16714223.html