Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e31f1e9b
提交
e31f1e9b
authored
2月 04, 2019
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Table value constructor can be used as a command
上级
46ac2ec7
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
74 行增加
和
54 行删除
+74
-54
help.csv
h2/src/docsrc/help/help.csv
+20
-12
TestScript.java
h2/src/test/org/h2/test/scripts/TestScript.java
+1
-1
select.sql
h2/src/test/org/h2/test/scripts/dml/select.sql
+0
-41
values.sql
h2/src/test/org/h2/test/scripts/dml/values.sql
+53
-0
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
e31f1e9b
...
...
@@ -250,19 +250,36 @@ Lists the schemas, tables, or the columns of a table.
SHOW TABLES
"
"Commands (DML)","Explicit
TABLE
","
"Commands (DML)","Explicit
table
","
TABLE [schemaName.]tableName
[ ORDER BY order [,...] ]
[ OFFSET expression { ROW | ROWS } ]
[ FETCH { FIRST | NEXT } [ expression [ PERCENT ] ] { ROW | ROWS }
{ ONLY | WITH TIES } ]
","
Selects data from a table.
This command is an equivalent to SELECT * FROM tableName.
FROM, WHERE, GROUP BY, HAVING, QUALIFY, and WINDOW clauses from the SELECT command are not allowed.
See SELECT command for description of ORDER BY, OFFSET, and FETCH.
","
TABLE TEST;
TABLE TEST ORDER BY ID FETCH FIRST ROW ONLY;
"
"Commands (DML)","Table value","
VALUES rowValueExpression [,...]
[ ORDER BY order [,...] ]
[ OFFSET expression { ROW | ROWS } ]
[ FETCH { FIRST | NEXT } [ expression [ PERCENT ] ] { ROW | ROWS }
{ ONLY | WITH TIES } ]
","
A list of rows that can be used like a table.
See SELECT command for description of ORDER BY, OFFSET, and FETCH.
The column list of the resulting table is C1, C2, and so on.
","
VALUES (1, 'Hello'), (2, 'World');
"
"Commands (DML)","WITH","
WITH [ RECURSIVE ] { name [( columnName [,...] )] AS ( select ) [,...] }
{ select | insert | update | merge | delete | createTable }
...
...
@@ -2629,15 +2646,6 @@ columns with the same name.
TEST AS T LEFT JOIN TEST AS T1 ON T.ID = T1.ID
"
"Other Grammar","Values Expression","
VALUES { ( expression [,...] ) } [,...]
","
A list of rows that can be used like a table.
The column list of the resulting table is C1, C2, and so on.
","
SELECT * FROM (VALUES(1, 'Hello'), (2, 'World')) AS V;
"
"Other Grammar","Wildcard expression","
{* | tableAlias.*} [EXCEPT ([tableAlias.]columnName, [,...])]
","
...
...
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
e31f1e9b
...
...
@@ -158,7 +158,7 @@ public class TestScript extends TestDb {
testScript
(
"ddl/"
+
s
+
".sql"
);
}
for
(
String
s
:
new
String
[]
{
"delete"
,
"error_reporting"
,
"insert"
,
"insertIgnore"
,
"merge"
,
"mergeUsing"
,
"replace"
,
"script"
,
"select"
,
"show"
,
"table"
,
"with"
})
{
"replace"
,
"script"
,
"select"
,
"show"
,
"table"
,
"
values"
,
"
with"
})
{
testScript
(
"dml/"
+
s
+
".sql"
);
}
for
(
String
s
:
new
String
[]
{
"help"
})
{
...
...
h2/src/test/org/h2/test/scripts/dml/select.sql
浏览文件 @
e31f1e9b
...
...
@@ -532,47 +532,6 @@ SELECT * FROM TEST WHERE (A, B) = (VALUES (11, 12));
DROP
TABLE
TEST
;
>
ok
VALUES
(
1
,
2
);
>
C1
C2
>
-- --
>
1
2
>
rows
:
1
VALUES
ROW
(
1
,
2
);
>
C1
C2
>
-- --
>
1
2
>
rows
:
1
VALUES
1
,
2
;
>
C1
>
--
>
1
>
2
>
rows
:
2
SELECT
*
FROM
(
VALUES
(
1
::
BIGINT
,
2
))
T
(
A
,
B
)
WHERE
(
A
,
B
)
IN
(
VALUES
(
1
,
2
));
>
A
B
>
-
-
>
1
2
>
rows
:
1
SELECT
*
FROM
(
VALUES
(
1000000000000
,
2
))
T
(
A
,
B
)
WHERE
(
A
,
B
)
IN
(
VALUES
(
1
,
2
));
>
A
B
>
-
-
>
rows
:
0
SELECT
*
FROM
(
VALUES
(
1
,
2
))
T
(
A
,
B
)
WHERE
(
A
,
B
)
IN
(
VALUES
(
1
::
BIGINT
,
2
));
>
A
B
>
-
-
>
1
2
>
rows
:
1
SELECT
*
FROM
(
VALUES
(
1
,
2
))
T
(
A
,
B
)
WHERE
(
A
,
B
)
IN
(
VALUES
(
1000000000000
,
2
));
>
A
B
>
-
-
>
rows
:
0
CREATE
TABLE
TEST
(
A
BIGINT
,
B
INT
)
AS
VALUES
(
1
::
BIGINT
,
2
);
>
ok
...
...
h2/src/test/org/h2/test/scripts/dml/values.sql
0 → 100644
浏览文件 @
e31f1e9b
-- 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
--
VALUES
(
1
,
2
);
>
C1
C2
>
-- --
>
1
2
>
rows
:
1
VALUES
ROW
(
1
,
2
);
>
C1
C2
>
-- --
>
1
2
>
rows
:
1
VALUES
1
,
2
;
>
C1
>
--
>
1
>
2
>
rows
:
2
VALUES
4
,
3
,
1
,
2
ORDER
BY
1
FETCH
FIRST
75
PERCENT
ROWS
ONLY
;
>
C1
>
--
>
1
>
2
>
3
>
rows
(
ordered
):
3
SELECT
*
FROM
(
VALUES
(
1
::
BIGINT
,
2
))
T
(
A
,
B
)
WHERE
(
A
,
B
)
IN
(
VALUES
(
1
,
2
));
>
A
B
>
-
-
>
1
2
>
rows
:
1
SELECT
*
FROM
(
VALUES
(
1000000000000
,
2
))
T
(
A
,
B
)
WHERE
(
A
,
B
)
IN
(
VALUES
(
1
,
2
));
>
A
B
>
-
-
>
rows
:
0
SELECT
*
FROM
(
VALUES
(
1
,
2
))
T
(
A
,
B
)
WHERE
(
A
,
B
)
IN
(
VALUES
(
1
::
BIGINT
,
2
));
>
A
B
>
-
-
>
1
2
>
rows
:
1
SELECT
*
FROM
(
VALUES
(
1
,
2
))
T
(
A
,
B
)
WHERE
(
A
,
B
)
IN
(
VALUES
(
1000000000000
,
2
));
>
A
B
>
-
-
>
rows
:
0
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论