1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

array_agg aggregate function, as per SQL:2008, but without ORDER BY clause

Rearrange the documentation a bit now that array_agg and xmlagg have similar
semantics and issues.

best of Robert Haas, Jeff Davis, Peter Eisentraut
This commit is contained in:
Peter Eisentraut
2008-11-13 15:59:51 +00:00
parent 69a0e2f76d
commit 3379fae6de
9 changed files with 164 additions and 23 deletions

View File

@ -395,3 +395,10 @@ select array_length(array[[1,2,3], [4,5,6]], 3);
select cardinality(array[1,2,3]);
select cardinality(array[[1,2,3], [4,5,6]]);
select c, cardinality(c), d, cardinality(d) from arrtest;
select array_agg(unique1) from tenk1 where unique1 < 15;
select array_agg(ten) from tenk1 where unique1 < 15;
select array_agg(nullif(ten, 4)) from tenk1 where unique1 < 15;
select cardinality(array_agg(unique1)) from tenk1 where unique1 < 15;
select array_agg(unique1) from (select * from tenk1 order by unique1 asc) as tab where unique1 < 15;
select array_agg(unique1) from tenk1 where unique1 < -15;