string_agg_distinct¶
Description¶
Returns concatenated input values, separated by the delimiter. The expression
must be a string column. The delimiter must be a string constant (it may be an
empty string). Different from string_agg,
string_agg_distinct
does not accept an order_by
argument, and the order of
values in the concatenated string is non-deterministic.
Return type¶
string
Domain¶
This is an aggregate function (aggregates rows over a group in aggregate verbs.)
Categories¶
Usage¶
string_agg_distinct(expr, delimiter)
Argument |
Type |
Optional |
Repeatable |
Restrictions |
---|---|---|---|---|
expr |
string |
no |
no |
none |
delimiter |
string |
no |
no |
constant |
Examples¶
statsby server_type:string_agg_distinct(server_type, ", "), group_by(region)
Set server_type
to a string list of all distinct server types for each region.
The order of the server types in each region is non-deterministic.