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
Content Type
Programming Reference
Publication ID
B035-1144-162K
Language
English (United States)
Last Update
2019-05-24

Order index rows on the AMPs. You cannot specify an ORDER BY clause in the definition of a column-partitioned join index. You cannot specify an ORDER BY clause in the definition for a partitioned join index. Sort order is restricted to ascending. If not specified in the ORDER BY clause, the join index rows on an AMP are sorted by the row hash of their primary index. See Teradata Vantage™ SQL Data Manipulation Language , B035-1146 for complete documentation of the ORDER BY clause.


column_name
Name of the column within the join index definition select column list used to order index rows on the AMPs. The ORDER BY clause of a join index can specify no more than one column name in its column list. You can specify a user-defined column named PARTITION or PARTITION#L n, where n ranges from 1 through 62. You cannot specify the system-derived columns PARTITION or PARTITION#L n as part of the ORDER BY list. 
Aggregate columns and expressions are not permitted in the ORDER BY clause. All ordering column names must be in the column_name_1 list. The column_name is limited to a maximum of four bytes of the following data types:
  • BYTEINT
  • DATE
  • DECIMAL
  • INTEGER
  • SMALLINT
column_position
The ordinal position of the column within the join index definition select column list used to order index rows on the AMPs.
column_alias
An alias for the column.
expression_alias
An alias for the expression.