使用 UNION 的查询中的一个析取项的正确术语是什么?
What is the proper term for one of the disjuncts in a query using UNION?
完成句子:在查询中
SELECT 0 UNION ALL SELECT 1;
子选择 SELECT 0
和 SELECT 1
被恰当地称为 UNION
的 ___________s。
我不是在寻找您对什么是好名字的意见 - 我希望您参考某种权威来源来支持您的回答。
我会说“结果集”。
A UNION concatenates result sets from two queries. But a UNION does
not create individual rows from columns gathered from two tables.
Oracle's documentation 将它们称为“组件查询”。
如果我正确理解标准 SQL 文档,这似乎叫做 <query term>
。
网上很难找到SQL:20xx,Itzik Ben-Gan在Fundamentals of table expressions
中展示了相关部分
7.17 <query expression>
Function
Specify a table.
Format
<query expression> ::=
[ <with clause> ] <query expression body>
[ <order by clause> ] [ <result offset clause> ] [ <fetch first clause> ]
<with clause> ::=
WITH [ RECURSIVE ] <with list>
<with list> ::=
<with list element> [ { <comma> <with list element> }… ]
<with list element> ::=
<query name> [ <left paren> <with column list> <right paren> ]
AS <table subquery> [ <search or cycle clause> ]
<with column list> ::=
<column name list>
<query expression body> ::=
<query term>
| <query expression body> UNION [ ALL | DISTINCT ]
[ <corresponding spec> ] <query term>
| <query expression body> EXCEPT [ ALL | DISTINCT ]
[ <corresponding spec> ] <query term>
<query term> ::=
<query primary>
| <query term> INTERSECT [ ALL | DISTINCT ]
[ <corresponding spec> ] <query primary>
<query primary> ::=
<simple table>
| <left paren> <query expression body>
[ <order by clause> ] [ <result offset clause> ] [ <fetch first clause> ]
<right paren>
<simple table> ::=
<query specification>
| <table value constructor>
| <explicit table>
<explicit table> ::=
TABLE <table or query name>
<corresponding spec> ::=
CORRESPONDING [ BY <left paren> <corresponding column list> <right paren> ]
<corresponding column list> ::=
<column name list>
<order by clause> ::=
ORDER BY <sort specification list>
<result offset clause> ::=
OFFSET <offset row count> { ROW | ROWS }
<fetch first clause> ::=
FETCH { FIRST | NEXT } [ <fetch first quantity> ] { ROW | ROWS } { ONLY | WITH TIES }
<fetch first quantity> ::=
<fetch first row count>
| <fetch first percentage>
<offset row count> ::=
<simple value specification>
<fetch first row count> ::=
<simple value specification>
<fetch first percentage> ::=
<simple value specification> PERCENT
完成句子:在查询中
SELECT 0 UNION ALL SELECT 1;
子选择 SELECT 0
和 SELECT 1
被恰当地称为 UNION
的 ___________s。
我不是在寻找您对什么是好名字的意见 - 我希望您参考某种权威来源来支持您的回答。
我会说“结果集”。
A UNION concatenates result sets from two queries. But a UNION does not create individual rows from columns gathered from two tables.
Oracle's documentation 将它们称为“组件查询”。
如果我正确理解标准 SQL 文档,这似乎叫做 <query term>
。
网上很难找到SQL:20xx,Itzik Ben-Gan在Fundamentals of table expressions
中展示了相关部分7.17 <query expression>
Function
Specify a table.
Format
<query expression> ::=
[ <with clause> ] <query expression body>
[ <order by clause> ] [ <result offset clause> ] [ <fetch first clause> ]
<with clause> ::=
WITH [ RECURSIVE ] <with list>
<with list> ::=
<with list element> [ { <comma> <with list element> }… ]
<with list element> ::=
<query name> [ <left paren> <with column list> <right paren> ]
AS <table subquery> [ <search or cycle clause> ]
<with column list> ::=
<column name list>
<query expression body> ::=
<query term>
| <query expression body> UNION [ ALL | DISTINCT ]
[ <corresponding spec> ] <query term>
| <query expression body> EXCEPT [ ALL | DISTINCT ]
[ <corresponding spec> ] <query term>
<query term> ::=
<query primary>
| <query term> INTERSECT [ ALL | DISTINCT ]
[ <corresponding spec> ] <query primary>
<query primary> ::=
<simple table>
| <left paren> <query expression body>
[ <order by clause> ] [ <result offset clause> ] [ <fetch first clause> ]
<right paren>
<simple table> ::=
<query specification>
| <table value constructor>
| <explicit table>
<explicit table> ::=
TABLE <table or query name>
<corresponding spec> ::=
CORRESPONDING [ BY <left paren> <corresponding column list> <right paren> ]
<corresponding column list> ::=
<column name list>
<order by clause> ::=
ORDER BY <sort specification list>
<result offset clause> ::=
OFFSET <offset row count> { ROW | ROWS }
<fetch first clause> ::=
FETCH { FIRST | NEXT } [ <fetch first quantity> ] { ROW | ROWS } { ONLY | WITH TIES }
<fetch first quantity> ::=
<fetch first row count>
| <fetch first percentage>
<offset row count> ::=
<simple value specification>
<fetch first row count> ::=
<simple value specification>
<fetch first percentage> ::=
<simple value specification> PERCENT