16.20 - ORDER BY - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-24
dita:mapPath
wkf1512081455740.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval

Index rows are ordered on each AMP by a single value- or hash-ordered column.

  • If you specify ORDER BY, then you must also specify column_name_2.
  • If you do not specify ORDER BY, Teradata Database orders rows by the hash value of all the columns in the column_name list.
VALUES
Value-ordering for the ORDER BY column.
If neither VALUES nor HASH is specified, VALUES is used as the default.
HASH
Hash-ordering for the ORDER BY column.
column_name_2
A single column from the column list defined by column_name that specifies the sort order to be used for either HASH or VALUES.
The size of the column is limited to four or fewer bytes. Supported numeric date types for column_name_2 are the following.
  • BYTEINT
  • DATE
  • DECIMAL
  • INTEGER
  • SMALLINT
If you specify ORDER BY without also specifying an explicit 
column_name_2, then the system assumes the first column specified in the column_name list.