Skip to content

Commit

Permalink
except
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Feb 9, 2025
1 parent 2a746bc commit 4e0832b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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 @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- [[#2330](https://github.com/mabel-dev/opteryx/issues/2330)] Add `HUMANIZE` function [@joocer](https://github.com/joocer)
- [[#2293](https://github.com/mabel-dev/opteryx/issues/2293)] [Optimizer] Rewrite `CASE` statements to `IFNULL` where possible [@joocer](https://github.com/joocer)
- [[#2357](https://github.com/mabel-dev/opteryx/issues/2357)] Prefer nested loop join for small relations [@joocer](https://github.com/joocer)
- [[#2372](https://github.com/mabel-dev/opteryx/issues/2372)] Add support from `SELECT * EXCEPT` [@joocer](https://github.com/joocer)

### Fixed

Expand Down
7 changes: 6 additions & 1 deletion docs/sql-reference/statements.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Retrieve rows from zero or more relations.

~~~sql
[ statement UNION [ ALL ] ... ]
SELECT [ DISTINCT [ ON (<columns>) ] ] <expression> [, ..]
SELECT [ DISTINCT [ ON (<columns>) ] ] <expression> [, ..] [EXCEPT (<columns>)]
FROM <relation> [AS <alias>]
FOR <period>
[ INNER ] JOIN <relation> | <function> | (<subquery>)
Expand Down Expand Up @@ -41,11 +41,16 @@ The default behaviour of the `UNION` class is to deduplicate rows, to return all
~~~
SELECT [ DISTINCT [ ON (columns )]] expression [, ...]
~~~
~~~
SELECT * EXCEPT (column[, ... ])
~~~

The `SELECT` clause specifies the list of columns that will be returned by the query. While it appears first in the clause, logically the expressions here are executed after most other clauses. The `SELECT` clause can contain arbitrary expressions that transform the output, as well as aggregate functions.

The `DISTINCT` modifier is specified, only unique rows are included in the result set. In this case, each output column must be of a type that allows comparison. `DISTINCT ON ()` will perform a distinct on the specified columns and select one value for other columns.

`EXCEPT` can be used to list columns to exclude from results.

### FROM / JOIN clauses

~~~
Expand Down

0 comments on commit 4e0832b

Please sign in to comment.