query_expression Syntax - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

Syntax

{ query_factor |
  query_expression { UNION | MINUS | EXCEPT } [ ALL ]
    { query_factor | ( query_expression ) ordering }
}

Syntax Elements

query_factor
query_expression
UNION
MINUS
EXCEPT
Set operators specifying how the two or more queries or subqueries are to combine and determine what result rows are required to be returned.
ALL
Allows duplicate rows to be returned.
ordering
ORDER BY expr_spec [,...]
expr_spec
expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
expression
An expression used in the ORDER BY clause to determine the sort order of returned rows in the result.
ASC
That the results are to be ordered in ascending sort order.
If the sort field is a character string, the system orders it in ascending order according to the definition of the collation sequence for the current session.
The default order is ASC.
DESC
That the results are to be ordered in descending sort order.
If the sort field is a character string, the system orders it in descending order according to the definition of the collation sequence for the current session.
NULLS FIRST
NULL results are to be listed first.
NULLS LAST
NULL results are to be listed last.