vault backup: 2023-11-03 11:09:53
This commit is contained in:
parent
2fe17ac58c
commit
65c4f689cc
17
sql/get.sql
17
sql/get.sql
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user