string_agg
The strings joined by option sep (default ","), in the measure's order_by.
Flags
| Flag | Value |
|---|---|
| Kind | aggregate |
| Nulls | nulls are skipped |
| Deterministic | yes |
| Order matters | yes |
| Decomposable | yes, by ordered strings |
Example
A pipeline from the language's tested corpus that uses string_agg, over the example tables.
from orders
aggregate {first_status = first(status, order_by: {placed}), last_status = last(status, order_by: {placed desc}), all_ids = list(id, order_by: {id}), names = string_agg(status, sep: "|", order_by: {id})} by:{customer}In a plan:
{
"args": [
{
"col": 7
}
],
"fn": "string_agg",
"options": {
"sep": "|"
}
}