array function - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

array function

Creates an array of the SUPER data type.

Syntax

ARRAY( [ expr1 ] [ , expr2 [ , ... ] ] )

Argument

expr1, expr2

Expressions of any Amazon Redshift data type except date and time types, since Amazon Redshift doesn't cast the date and time types to the SUPER data type. The arguments don't need to be of the same data type.

Return type

The array function returns the SUPER data type.

Example

The following examples show an array of numeric values and an array of different data types.

--an array of numeric values select array(1,50,null,100); array ------------------ [1,50,null,100] (1 row) --an array of different data types select array(1,'abc',true,3.14); array ----------------------- [1,"abc",true,3.14] (1 row)