Quantcast
Channel: Managing the order of aggregation in Postgres - Database Administrators Stack Exchange
Browsing latest articles
Browse All 3 View Live

Answer by Dragas for Managing the order of aggregation in postgres

In the Aggregate functions page (chapter 9, section 20 in postgresql 12 documentation "Aggregate Functions" (1)) there's a paragraph specifically addressing thisThe aggregate functions array_agg,...

View Article



Managing the order of aggregation in postgres

Suppose I have the following merging function that merges two jsonb values overwriting duplicate keys with the values from the secondcreate or replace function jsonb_concat(a jsonb, b jsonb) returns...

View Article

Answer by Erwin Brandstetter for Managing the order of aggregation in Postgres

The manual goes on to say:... Alternatively, supplying the input values from a sorted subquerywill usually work. For example:SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;In fact,...

View Article
Browsing latest articles
Browse All 3 View Live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>