Repository: incubator-trafodion Updated Branches: refs/heads/master 1c26c9335 -> 26303ed38
[TRAFODION-2406] update sql reference manual about INTERSECT/EXCEPT syntax Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/7aa84e03 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/7aa84e03 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/7aa84e03 Branch: refs/heads/master Commit: 7aa84e03ed3734835cd2f5033bc1219d82496bc3 Parents: c5568f2 Author: Liu Ming <[email protected]> Authored: Thu Dec 22 15:05:29 2016 +0000 Committer: Liu Ming <[email protected]> Committed: Thu Dec 22 15:05:29 2016 +0000 ---------------------------------------------------------------------- .../src/asciidoc/_chapters/sql_statements.adoc | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7aa84e03/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---------------------------------------------------------------------- diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc index d76d94c..4541828 100644 --- a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc +++ b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc @@ -6275,6 +6275,8 @@ query-expr-and-order is: query-expr is: query-primary | query-expr UNION [ALL] query-primary + | query-expr INTERSECT query-primary + | query-expr EXCEPT query-primary query-primary is: simple-table | (query-expr) @@ -6777,6 +6779,29 @@ The column names in the result table of the union are the same as the correspond SELECT statement. A column resulting from the union of expressions or constants has the name (EXPR). See <<considerations_for_union,Considerations for UNION>>. +* `_select-stmt_ INTERSECT _select-stmt_` ++ +specifies a set intersect operation between the result table of a SELECT statement and the result table of another SELECT statement. +The result of the intersect operation is a table that consists of rows appear in both result sets. ++ +The result of INTERSECT does not contain any duplicate rows. ++ +The select lists in the two SELECT statements of an intersect operation must have the same number of columns, and columns in +corresponding positions within the lists must have compatible data types. The select lists must not be preceded by +[ANY _N_] or [FIRST N]. + +* `_select-stmt_ EXCEPT _select-stmt_` ++ +specifies a set except operation between the result table of a SELECT statement and the result table of another SELECT statement. +The result of the except operation is a table that consists of rows that are in the result of the left SELECT statement but not in +the result of the right one. ++ +The result of EXCEPT does not contain any duplicate rows. ++ +The select lists in the two SELECT statements of an except operation must have the same number of columns, and columns in +corresponding positions within the lists must have compatible data types. The select lists must not be preceded by +[ANY _N_] or [FIRST N]. + * `ORDER BY {_colname_ | _colnum_} [ASC[ENDING] | DESC[ENDING]] [,{_colname_ | _colnum_} [ASC[ENDING] | DESC[ENDING]]]…` + specifies the order in which to sort the rows of the final result table.
