work on aggregating to the price point
This commit is contained in:
parent
fcdb134b76
commit
01b70dce3c
@ -197,9 +197,20 @@ FROM
|
|||||||
--SELECT * FROM items_init where seq = 1
|
--SELECT * FROM items_init where seq = 1
|
||||||
--SELECT * FROM items where seq = 1
|
--SELECT * FROM items where seq = 1
|
||||||
----join conversion back to data initial part link------------------------------
|
----join conversion back to data initial part link------------------------------
|
||||||
|
,joinback_init AS (
|
||||||
SELECT
|
SELECT
|
||||||
i.*
|
i.stlc
|
||||||
,c.*
|
,i.coltier
|
||||||
|
,i.branding
|
||||||
|
,i.accs
|
||||||
|
,i.suffix
|
||||||
|
,i.pckg
|
||||||
|
,i.col
|
||||||
|
,i.vol_uom
|
||||||
|
,i.vol_qty
|
||||||
|
,i.price
|
||||||
|
,c.nm
|
||||||
|
,c.dm
|
||||||
,l.clist
|
,l.clist
|
||||||
FROM
|
FROM
|
||||||
items_init i
|
items_init i
|
||||||
@ -213,3 +224,13 @@ ORDER BY
|
|||||||
i.stlc
|
i.stlc
|
||||||
,i.coltier
|
,i.coltier
|
||||||
,i.col
|
,i.col
|
||||||
|
)
|
||||||
|
,agg_levels AS (
|
||||||
|
SELECT
|
||||||
|
stlc
|
||||||
|
,jsonb_agg(DISTINCT coltier) coltier
|
||||||
|
,jsonb_agg(branding)
|
||||||
|
,jsonb_agg(DISTINCT
|
||||||
|
,jsonb_agg(DISTINCT
|
||||||
|
,jsonb_agg(DISTINCT
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user