在使用union的查询中,对其中一个间断的恰当术语是什么?

qv7cva1a  于 2021-07-26  发布在  Java
关注(0)|答案(3)|浏览(268)

完成句子:在查询中

SELECT 0 UNION ALL SELECT 1;

子对象选择 SELECT 0 以及 SELECT 1 被称为 UNION .
我不是想听听你对什么是好名字的看法,我希望你能引用一些权威的资料来支持你的回答。

bbuxkriu

bbuxkriu1#

如果我正确地理解了标准sql文档,这似乎就是 <query term> .
很难找到sql:20xx online,伊兹克本根展示了表表达式基础中的相关部分

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
quhf5bfb

quhf5bfb2#

我要说的是“结果集”。
联合连接两个查询的结果集。但是联合不会从两个表中收集的列中创建单独的行。
从这里开始:https://docs.microsoft.com/en-us/sql/t-sql/language-elements/set-operators-union-transact-sql?view=sql-server-ver15

ui7jx7zq

ui7jx7zq3#

oracle的文档将它们称为“组件查询”。

相关问题