aggregate_factory.sql 644 B

123456789101112131415161718192021222324252627
  1. select
  2. Pg::string_agg(x,','p)
  3. from (values ('a'p),('b'p),('c'p)) as a(x);
  4. select
  5. Pg::string_agg(x,','p) over (order by x),
  6. from (values ('a'p),('b'p),('c'p)) as a(x);
  7. $agg_string_agg = AggregationFactory("Pg::string_agg");
  8. select
  9. AggregateBy((x,','p),$agg_string_agg)
  10. from (values ('a'p),('b'p),('c'p)) as a(x);
  11. select
  12. AggregateBy((x,','p),$agg_string_agg) over (order by x),
  13. from (values ('a'p),('b'p),('c'p)) as a(x);
  14. $agg_max = AggregationFactory("Pg::max");
  15. select
  16. AggregateBy(x,$agg_max)
  17. from (values ('a'p),('b'p),('c'p)) as a(x);
  18. select
  19. AggregateBy(x,$agg_max) over (order by x),
  20. from (values ('a'p),('b'p),('c'p)) as a(x);