MySQL supports window functions that, for each row from a query, perform a calculation using rows related to that row. MySQL支持窗口函数,对于查询中的每一行,使用与该行相关的行执行计算。The following sections discuss how to use window functions, including descriptions of the 以下部分讨论如何使用窗口函数,包括OVER
and WINDOW
clauses. OVER
和window
子句的描述。The first section provides descriptions of the nonaggregate window functions. 第一节介绍非聚集窗口函数。For descriptions of the aggregate window functions, see Section 12.20.1, “Aggregate Function Descriptions”.有关聚合窗口函数的描述,请参阅第12.20.1节,“聚合函数描述”。
For information about optimization and window functions, see Section 8.2.1.21, “Window Function Optimization”.有关优化和窗口函数的信息,请参阅第8.2.1.21节,“窗口函数优化”。