ARRAY_AGG Function | Data Types and Literals | Teradata Vantage - ARRAY_AGG - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

An aggregate function for use with ARRAY data types that allows arrays to be created as part of the SELECT list of a query.

Syntax

[TD_SYSFNLIB.] ARRAY_AGG (
  element_value_expr
  [ ORDER BY value_expression [ ASC | DESC ] ] ,
  array_expression
)
TD_SYSFNLIB.
Name of the database where the function is located.
element_value_expr
An expression that evaluates to an ARRAY element type.
value_expression
An expression that evaluates to a Teradata data type that can be compared.
ASC
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
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.
array_expression
An ARRAY expression, which is one of the following:
  • A reference to an ARRAY column
  • An ARRAY constructor expression
  • A UDF expression
  • A UDM expression