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
|
||||
agglevel ASC
|
||||
)
|
||||
,final AS (
|
||||
,aggfinal AS (
|
||||
SELECT
|
||||
jsonb_build_object(
|
||||
agg.agglvl,
|
||||
jsonb_build_object(
|
||||
'data',
|
||||
jsonb_agg(gset || jsonb_build_object('season',season))
|
||||
)
|
||||
) data
|
||||
,gdoc
|
||||
FROM
|
||||
@ -58,4 +55,14 @@ getj AS (
|
||||
agglvl
|
||||
,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