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