add list of customers
This commit is contained in:
parent
f34b0d539d
commit
3540c35629
@ -157,6 +157,17 @@ GROUP BY
|
|||||||
('volume')
|
('volume')
|
||||||
) x(tag)
|
) x(tag)
|
||||||
)
|
)
|
||||||
|
,custs AS (
|
||||||
|
SELECT
|
||||||
|
bill_cust_descr
|
||||||
|
,ship_cust_descr
|
||||||
|
,SUM(value_usd) value_usd
|
||||||
|
FROM
|
||||||
|
base
|
||||||
|
GROUP BY
|
||||||
|
bill_cust_descr
|
||||||
|
,ship_cust_descr
|
||||||
|
)
|
||||||
SELECT
|
SELECT
|
||||||
jsonb_build_object(
|
jsonb_build_object(
|
||||||
'months'
|
'months'
|
||||||
@ -169,4 +180,6 @@ SELECT
|
|||||||
,(SELECT jsonb_agg(row_to_json(totals)::jsonb) FROM totals)
|
,(SELECT jsonb_agg(row_to_json(totals)::jsonb) FROM totals)
|
||||||
,'tags'
|
,'tags'
|
||||||
,(SELECT jsonb_agg(tag) FROM tags)
|
,(SELECT jsonb_agg(tag) FROM tags)
|
||||||
|
,'customers'
|
||||||
|
,(SELECT jsonb_agg(row_to_json(custs)::jsonb) FROM custs)
|
||||||
) package
|
) package
|
Loading…
Reference in New Issue
Block a user