欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

SQL面试题-数据转换-窗口函数应用

时间:2023-07-13

hive> select * from temp;OK1abc101def151xyz202abc132xyz403def503abc60Time taken: 0.282 seconds, Fetched: 7 row(s)hive> select cn,dt,sum(point) over(partition by cn order by dt) as sumpoint from temp order by sumpoint;OKabc110def115xyz120abc223xyz260def365abc383Time taken: 9.746 seconds, Fetched: 7 row(s)

SQL如下

select cn,dt,sum(point) over(partition by cn order by dt) as sumpoint from temp order by sumpoint;

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。