Skip to content

Commit

Permalink
#21
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Jan 8, 2024
1 parent edaad24 commit 5722886
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/get-started/external-standards/sql92.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ E061-13 | Correlated subqueries | unknown
E061-14 | Search condition | unknown
**E071** | **Basic query expressions** | unknown
E071-01 | `UNION DISTINCT` table operator | no
E071-02 | `UNION ALL` table operator | no
E071-02 | `UNION ALL` table operator | partial
E071-03 | `EXCEPT DISTINCT` table operator | no
E071-05 | Columns combined via table operators need not have exactly the same data type | partial
E071-06 | Table operators in subqueries | unknown
Expand Down
1 change: 1 addition & 0 deletions docs/get-started/release-notes/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- [[#1362](https://github.com/mabel-dev/opteryx/pull/1362)] Shortcut OR evaluations [@joocer](https://github.com/joocer)
- [[#1365](https://github.com/mabel-dev/opteryx/pull/1365)] Shortcut nested AND evaluations [@joocer](https://github.com/joocer)
- [[#1367](https://github.com/mabel-dev/opteryx/pull/1367)] Support UNION statements [@joocer](https://github.com/joocer)

## [0.12.0] - 2024-01-02

Expand Down
11 changes: 11 additions & 0 deletions docs/sql-reference/statements.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The following statement forms are supported.
Retrieve rows from zero or more relations.

~~~sql
[ statement UNION [ ALL ] ... ]
SELECT [ DISTINCT [ ON (<columns>) ] ] <expression> [, ..]
FROM <relation> [AS <alias>]
FOR <period>
Expand All @@ -25,6 +26,16 @@ OFFSET <offset>
LIMIT <limit>
~~~

### UNION class

~~~
statement UNION [ ALL ] statement
~~~

The `UNION` class appends the results of two queries together one after the other. The names and types of the resulting columns are taken from the first statement, names in the second statement are ignored and types are coerced where possible.

The default behaviour of the `UNION` class is to deduplicate rows, to return all rows, including duplicates the `ALL` modifier must be used.

### SELECT clause

~~~
Expand Down

0 comments on commit 5722886

Please sign in to comment.