提交 504155d9 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix a typo and add missing file

上级 279be7f8
......@@ -5552,7 +5552,7 @@ RATIO_TO_REPORT(value)
OVER windowNameOrSpecification
","
Returns the ratio of a value to the sum of all values.
Is argument is NULL or sum of all values is 0, then the value of function is NULL.
If argument is NULL or sum of all values is 0, then the value of function is NULL.
Window functions are currently experimental in H2 and should be used with caution.
They also may require a lot of memory for large queries.
......
-- Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
CREATE TABLE TEST(ID INT PRIMARY KEY, N NUMERIC);
> ok
INSERT INTO TEST VALUES(1, 1), (2, 2), (3, NULL), (4, 5);
> update count: 4
SELECT ID, N, RATIO_TO_REPORT(N) OVER() R2R FROM TEST;
> ID N R2R
> -- ---- -----
> 1 1 0.125
> 2 2 0.25
> 3 null null
> 4 5 0.625
> rows: 4
INSERT INTO TEST VALUES (5, -8);
> update count: 1
SELECT ID, N, RATIO_TO_REPORT(N) OVER() R2R FROM TEST;
> ID N R2R
> -- ---- ----
> 1 1 null
> 2 2 null
> 3 null null
> 4 5 null
> 5 -8 null
> rows: 5
DROP TABLE TEST;
> ok
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论