Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4e96e4d0
提交
4e96e4d0
authored
2月 05, 2019
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move QUALIFY clause after WINDOW clause
上级
cb8d0ff9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
12 行增加
和
12 行删除
+12
-12
help.csv
h2/src/docsrc/help/help.csv
+1
-1
Parser.java
h2/src/main/org/h2/command/Parser.java
+5
-5
row_number.sql
.../test/org/h2/test/scripts/functions/window/row_number.sql
+6
-6
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
4e96e4d0
...
@@ -11,8 +11,8 @@ selectExpression [,...]
...
@@ -11,8 +11,8 @@ selectExpression [,...]
[ FROM tableExpression [,...] ]
[ FROM tableExpression [,...] ]
[ WHERE expression ]
[ WHERE expression ]
[ GROUP BY expression [,...] ] [ HAVING expression ]
[ GROUP BY expression [,...] ] [ HAVING expression ]
[ QUALIFY expression ]
[ WINDOW { { windowName AS windowSpecification } [,...] } ]
[ WINDOW { { windowName AS windowSpecification } [,...] } ]
[ QUALIFY expression ]
[ { UNION [ ALL ] | EXCEPT | MINUS | INTERSECT } select ]
[ { UNION [ ALL ] | EXCEPT | MINUS | INTERSECT } select ]
[ ORDER BY order [,...] ]
[ ORDER BY order [,...] ]
[ LIMIT expression [ OFFSET expression ] [ SAMPLE_SIZE rowCountInt ] ]
[ LIMIT expression [ OFFSET expression ] [ SAMPLE_SIZE rowCountInt ] ]
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
4e96e4d0
...
@@ -2750,11 +2750,6 @@ public class Parser {
...
@@ -2750,11 +2750,6 @@ public class Parser {
Expression
condition
=
readExpression
();
Expression
condition
=
readExpression
();
command
.
setHaving
(
condition
);
command
.
setHaving
(
condition
);
}
}
if
(
readIf
(
QUALIFY
))
{
command
.
setWindowQuery
();
Expression
condition
=
readExpression
();
command
.
setQualify
(
condition
);
}
if
(
readIf
(
WINDOW
))
{
if
(
readIf
(
WINDOW
))
{
do
{
do
{
int
index
=
parseIndex
;
int
index
=
parseIndex
;
...
@@ -2766,6 +2761,11 @@ public class Parser {
...
@@ -2766,6 +2761,11 @@ public class Parser {
}
}
}
while
(
readIf
(
COMMA
));
}
while
(
readIf
(
COMMA
));
}
}
if
(
readIf
(
QUALIFY
))
{
command
.
setWindowQuery
();
Expression
condition
=
readExpression
();
command
.
setQualify
(
condition
);
}
command
.
setParameterList
(
parameters
);
command
.
setParameterList
(
parameters
);
currentSelect
=
oldSelect
;
currentSelect
=
oldSelect
;
currentPrepared
=
oldPrepared
;
currentPrepared
=
oldPrepared
;
...
...
h2/src/test/org/h2/test/scripts/functions/window/row_number.sql
浏览文件 @
4e96e4d0
...
@@ -84,12 +84,12 @@ SELECT *,
...
@@ -84,12 +84,12 @@ SELECT *,
>
rows
:
9
>
rows
:
9
SELECT
*
,
SELECT
*
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
CATEGORY
ORDER
BY
ID
)
RN
,
ROW_NUMBER
()
OVER
W
RN
,
RANK
()
OVER
(
PARTITION
BY
CATEGORY
ORDER
BY
ID
)
RK
,
RANK
()
OVER
W
RK
,
DENSE_RANK
()
OVER
(
PARTITION
BY
CATEGORY
ORDER
BY
ID
)
DR
,
DENSE_RANK
()
OVER
W
DR
,
ROUND
(
PERCENT_RANK
()
OVER
(
PARTITION
BY
CATEGORY
ORDER
BY
ID
)
,
2
)
PR
,
ROUND
(
PERCENT_RANK
()
OVER
W
,
2
)
PR
,
ROUND
(
CUME_DIST
()
OVER
(
PARTITION
BY
CATEGORY
ORDER
BY
ID
)
,
2
)
CD
ROUND
(
CUME_DIST
()
OVER
W
,
2
)
CD
FROM
TEST
QUALIFY
ROW_NUMBER
()
OVER
(
PARTITION
BY
CATEGORY
ORDER
BY
ID
)
=
2
;
FROM
TEST
WINDOW
W
AS
(
PARTITION
BY
CATEGORY
ORDER
BY
ID
)
QUALIFY
ROW_NUMBER
()
OVER
W
=
2
;
>
ID
CATEGORY
VALUE
RN
RK
DR
PR
CD
>
ID
CATEGORY
VALUE
RN
RK
DR
PR
CD
>
-- -------- ----- -- -- -- --- ----
>
-- -------- ----- -- -- -- --- ----
>
2
1
12
2
2
2
0
.
5
0
.
67
>
2
1
12
2
2
2
0
.
5
0
.
67
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论