窗口函数和group by
时间: 2023-08-23 22:05:32 浏览: 105
窗口函数和group by都是用于对查询结果进行分组操作的。它们的区别在于,窗口函数会对每个分组之后的数据进行分别操作,而group by一般对分组之后的函数使用聚集函数汇总。窗口函数是在where或group by子句处理后的结果上进行操作,因此通常只能写在select子句中。而且,窗口函数可以对分组数据进行开窗操作,以获取每个分组中的具体数据,而group by无法实现这样的操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [【mysql学习笔记】窗口函数汇总](https://blog.csdn.net/m0_63073742/article/details/124998616)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [group by 和 开窗函数](https://blog.csdn.net/haidengfashi/article/details/116591398)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文