window 函数和 group by 子句如何交互?
How do window functions and the group by clause interact?
我确实理解window functions and group by。
但是当您在同一查询中同时使用 window 函数和 group by 子句时会发生什么?
- 所选行是否先分组,然后由 window 函数考虑?
- 或者 window 函数是否先执行,然后结果值按
group by
分组?
- 还有别的吗?
If the query contains any window functions, these functions are evaluated after any grouping, aggregation, and HAVING filtering is performed
强调我的
我确实理解window functions and group by。
但是当您在同一查询中同时使用 window 函数和 group by 子句时会发生什么?
- 所选行是否先分组,然后由 window 函数考虑?
- 或者 window 函数是否先执行,然后结果值按
group by
分组? - 还有别的吗?
If the query contains any window functions, these functions are evaluated after any grouping, aggregation, and HAVING filtering is performed
强调我的