Greenplum 中的窗口函数详解
最编程
2024-07-23 08:01:22
...
tutorial=> select id, name , sum(id) over () sum1,
tutorial-> sum(id) over (order by id) sum2,
tutorial-> sum(id) over ( partition by name) sum3,
tutorial-> sum(id) over ( partition by name order by name desc) sum4
tutorial-> from test002;
id | name | sum1 | sum2 | sum3 | sum4
----+------+------+------+------+------
1 | gh2 | 16 | 2 | 9 | 9
1 | gh | 16 | 2 | 1 | 1
2 | gh2 | 16 | 6 | 9 | 9
2 | gh2 | 16 | 6 | 9 | 9
3 | gh4 | 16 | 12 | 3 | 3
3 | gh3 | 16 | 12 | 3 | 3
4 | gh2 | 16 | 16 | 9 | 9
(7 rows)
推荐阅读
-
C++ 中的引用详解
-
OpenCV 高级图形用户界面(9)中更改指定窗口位置的函数 moveWindow 的使用--代码示例
-
模块:Nuxt.js 应用程序中的事件钩子前详解
-
OpenCV 高级图形用户界面(6)中获取指定窗口图像矩形区域的函数 getWindowImageRect 的使用--代码示例
-
HBase 中的先写日志详解
-
玩转JS函数式编程_013] 4.1 JavaScript纯函数相关概念(中4.1 JavaScript 纯函数相关概念(中):函数副作用的几种具体表现
-
Oracle 处理空值(NVL、NVL2、NULLIF 等)的函数详解-I。函数语法
-
图像处理] DR 图像后期处理中的窗口宽度和窗口位置简述-3.
-
解释 JavaScript 中函数的实参和形参
-
双向链表中插入函数的 C++ 标准库实现。-示例 1: