vault backup: 2023-11-03 11:09:53

This commit is contained in:
Paul Trowbridge 2023-11-03 11:09:53 -04:00
parent 2fe17ac58c
commit 65c4f689cc

View File

@ -42,14 +42,11 @@ getj AS (
ORDER BY ORDER BY
agglevel ASC agglevel ASC
) )
,final AS ( ,aggfinal AS (
SELECT SELECT
jsonb_build_object( jsonb_build_object(
agg.agglvl, agg.agglvl,
jsonb_build_object(
'data',
jsonb_agg(gset || jsonb_build_object('season',season)) jsonb_agg(gset || jsonb_build_object('season',season))
)
) data ) data
,gdoc ,gdoc
FROM FROM
@ -58,4 +55,14 @@ getj AS (
agglvl agglvl
,gdoc ,gdoc
) )
select * from final ,final AS (
SELECT
public.jsonb_obj_aggc(data) data
, gdoc
FROM
aggfinal
GROUP BY
gdoc
)
--SELECT gdoc, jsonb_pretty(data) FROM final
SELECT gdoc, data FROM final