ORDER BY grouping_or_ordering_specification - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

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.