add list of customers
This commit is contained in:
parent
f34b0d539d
commit
3540c35629
@ -157,6 +157,17 @@ GROUP BY
|
||||
('volume')
|
||||
) 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
|
||||
jsonb_build_object(
|
||||
'months'
|
||||
@ -169,4 +180,6 @@ SELECT
|
||||
,(SELECT jsonb_agg(row_to_json(totals)::jsonb) FROM totals)
|
||||
,'tags'
|
||||
,(SELECT jsonb_agg(tag) FROM tags)
|
||||
,'customers'
|
||||
,(SELECT jsonb_agg(row_to_json(custs)::jsonb) FROM custs)
|
||||
) package
|
Loading…
Reference in New Issue
Block a user