Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
fe56f187
提交
fe56f187
authored
2月 04, 2019
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve documentation of SELECT command
上级
1a7ff068
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
26 行增加
和
10 行删除
+26
-10
help.csv
h2/src/docsrc/help/help.csv
+26
-10
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
fe56f187
# 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
"SECTION","TOPIC","SYNTAX","TEXT","EXAMPLE"
"Commands (DML)","SELECT","
SELECT [ TOP term [ PERCENT ] [ WITH TIES ] ]
[ DISTINCT [ ON ( expression [,...] ) ] | ALL ]
...
...
@@ -20,26 +22,37 @@ selectExpression [,...]
[ FOR UPDATE ]
","
Selects data from a table or multiple tables.
WHERE filters rows before other operations.
GROUP BY groups the result by the given expression(s).
Command is executed in the following logical order:
1. Data is taken from table value expressions that are specified in the FROM clause, joins are executed.
If FROM clause is not specified a single row is constructed.
2. WHERE filters rows. Aggregate or window functions are not allowed in this clause.
3. GROUP BY groups the result by the given expression(s).
If GROUP BY clause is not specified, but non-window aggregate functions are used or HAVING is specified
all rows are grouped together.
Aggregate functions are evaluated, SAMPLE_SIZE limits the number of rows read.
HAVING filters rows after grouping and evaluation of aggregate functions.
Window functions are evaluated.
QUALIFY filters rows after evaluation of window functions.
4. Aggregate functions are evaluated, SAMPLE_SIZE limits the number of rows read.
DISTINCT removes duplicates.
5. HAVING filters rows after grouping and evaluation of aggregate functions.
Non-window aggregate functions are allowed in this clause.
UNION, EXCEPT (MINUS), and INTERSECT combine the result of this query with the results of another query.
6. Window functions are evaluated.
7. QUALIFY filters rows after evaluation of window functions.
Aggregate and window functions are allowed in this clause.
8. DISTINCT removes duplicates. If DISTINCT ON is used only the specified expressions are checked for duplicates.
9. UNION, EXCEPT (MINUS), and INTERSECT combine the result of this query with the results of another query.
Multiple set operators (UNION, INTERSECT, MINUS, EXCEPT) are evaluated from left to right.
For compatibility with other databases and future versions of H2 please use parentheses.
ORDER BY sorts the result by the given column(s) or expression(s).
10.
ORDER BY sorts the result by the given column(s) or expression(s).
Number of rows in output can be limited either with standard OFFSET / FETCH,
11.
Number of rows in output can be limited either with standard OFFSET / FETCH,
with non-standard LIMIT / OFFSET, or with non-standard TOP clauses.
Different clauses cannot be used together.
OFFSET specifies how many rows to skip.
...
...
@@ -50,6 +63,9 @@ and should be an integer value between 0 and 100 inclusive.
WITH TIES can be used only together with ORDER BY and means that all additional rows that have the same sorting position
as the last row will be also returned.
WINDOW clause specifies window definitions for window functions and window aggregate functions.
This clause can be used to reuse the same definition in multiple functions.
If FOR UPDATE is specified, the tables or rows are locked for writing.
This clause is not allowed in DISTINCT queries and in queries with non-window aggregates, GROUP BY, or HAVING clauses.
When using default MVStore engine only the selected rows are locked as in an UPDATE statement;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论