# array_agg¶

## Description¶

Returns an array of concatenated input values. The expression must be a valid expression (not a regex or other type). If no ordering is specified, the default ordering is that of the invoking verb, which is generally the ‘valid_from’ timestamp, ascending.

array

## Domain¶

This is an aggregate function (aggregates rows over a group in aggregate verbs.)

## Usage¶

array_agg( expr [ , order_by ] )


Argument

Type

Required

Multiple

expr

any

Required

Only one

order_by

ordering

Optional

Only one

## Examples¶

statsby nicknames:array_agg(nickname, order_by(email)), group_by(uid, fullname)


An array containing all nicknames for each individual in the organization; for users with more than one nickname they will be sorted by email address.