IZ
Size: a a a
IZ
IZ
IZ
A
IZ
IZ
IZ
YS
A
A
YS
A
IZ
YS
WITH t(n, x) AS (
VALUES (1, '2'), (4, '1'), (2, '8')
)
SELECT n, x, string_agg(x, ',') OVER (ORDER BY n DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
FROM t;
A
IZ
YS
string_agg ( value text, delimiter text ) → text
Concatenates the non-null input values into a string. Each value after the first is preceded by the corresponding delimiter (if it's not null).
A
WITH t(n, x) AS (
VALUES (1, '2'), (4, '1'), (2, '8')
)
SELECT n, x, string_agg(x, ',') OVER (ORDER BY n DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
FROM t;
IZ
A