aggregate attributes to the price level
This commit is contained in:
parent
01b70dce3c
commit
460912af7c
@ -228,9 +228,27 @@ ORDER BY
|
|||||||
,agg_levels AS (
|
,agg_levels AS (
|
||||||
SELECT
|
SELECT
|
||||||
stlc
|
stlc
|
||||||
,jsonb_agg(DISTINCT coltier) coltier
|
,string_agg(DISTINCT coltier ,', ') FILTER (WHERE clist IS NOT NULL) coltier
|
||||||
,jsonb_agg(branding)
|
,string_agg(DISTINCT branding,', ') branding
|
||||||
,jsonb_agg(DISTINCT
|
,string_agg(DISTINCT accs ,', ') accs
|
||||||
,jsonb_agg(DISTINCT
|
,string_agg(DISTINCT suffix ,', ') suffix
|
||||||
,jsonb_agg(DISTINCT
|
,pckg
|
||||||
|
,col
|
||||||
|
,vol_uom
|
||||||
|
,voL_qty
|
||||||
|
,price
|
||||||
|
,regexp_replace(jsonb_arr_aggcd(clist)::text,'["\[\]]|null, ','','g') clist
|
||||||
|
FROM
|
||||||
|
joinback_init
|
||||||
|
GROUP BY
|
||||||
|
stlc
|
||||||
|
,pckg
|
||||||
|
,col
|
||||||
|
,vol_uom
|
||||||
|
,vol_qty
|
||||||
|
,price
|
||||||
)
|
)
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
agg_levels
|
||||||
|
Loading…
Reference in New Issue
Block a user