17.00 - ORDER BY grouping_or_ordering_specification - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

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.