sort result sets by id

This commit is contained in:
Paul Trowbridge 2021-06-02 15:50:21 +00:00
parent 3fe5126861
commit f548780d9f
2 changed files with 5 additions and 3 deletions

View File

@ -82,8 +82,10 @@ GROUP BY
,tag
,comment
,substance
ORDER BY
logid ASC
)
SELECT
json_agg(row_to_json(rows)) x
FROM
rows
rows

View File

@ -25,7 +25,7 @@ group BY
,jsonb_pretty(ol.doc)
,ol.id
ORDER BY
(ol.doc->>'stamp')::timestamptz desc
ol.id desc
)
SELECT
jsonb_agg(row_to_json(agg)::jsonb ORDER BY agg.stamp desc) x from agg
jsonb_agg(row_to_json(agg)::jsonb ORDER BY agg.id desc) x from agg