SQL 标准对窗口函数施加了限制,即不能在 UPDATE 或 DELETE 语句中用于更新行。但允许在这些语句的子查询中使用此类函数(用于选择行)。The SQL standard imposes a constraint on window functions that
they cannot be used in UPDATE or
DELETE statements to update rows.
Using such functions in a subquery of these statements (to
select rows) is permitted.
MySQL 不支持以下窗口函数特性:MySQL does not support these window function features:
DISTINCT聚合窗口函数的语法。DISTINCTsyntax for aggregate window functions.嵌套窗口函数。Nested window functions.
依赖于当前行的值的动态帧端点。Dynamic frame endpoints that depend on the value of the current row.
解析器识别这些窗口结构,但它们仍然不被支持:The parser recognizes these window constructs which nevertheless are not supported:
GROUPS帧单位说明符已解析,但会产生错误。仅支持ROWS和RANGE。TheGROUPSframe units specifier is parsed, but produces an error. OnlyROWSandRANGEare supported.用于帧规范的
EXCLUDE子句已解析,但会产生错误。TheEXCLUDEclause for frame specification is parsed, but produces an error.IGNORE NULLS已解析,但会产生错误。仅支持RESPECT NULLS。IGNORE NULLSis parsed, but produces an error. OnlyRESPECT NULLSis supported.FROM LAST已解析,但会产生错误。仅支持FROM FIRST。FROM LASTis parsed, but produces an error. OnlyFROM FIRSTis supported.
对于给定的SELECT,最多支持 127 个窗口。请注意,一个查询可以使用多个SELECT子句,并且每个子句最多支持 127 个窗口。不同窗口的数量被定义为命名窗口与作为任何窗口函数OVER子句的一部分指定的任何隐式窗口之和。你还应该注意,使用大量窗口的查询可能需要增加默认线程栈大小(thread_stack系统变量)。A maximum of 127 windows is supported for a given
SELECT. Note that a single query
may use multiple SELECT clauses, and each of
these clauses supports up to 127 windows. The number of distinct
windows is defined as the sum of the named windows and any
implicit windows specified as part of any window function's
OVER clause. You should also be aware that
queries using very large numbers of windows may require
increasing the default thread stack size
(thread_stack system variable).