more work

This commit is contained in:
Paul Trowbridge 2021-01-11 22:37:16 -05:00
parent 412f0ec082
commit 690b325e78
1 changed files with 5 additions and 1 deletions

View File

@ -130,7 +130,7 @@ SELECT
--retain this column to re-pivot back to original format
,up.col
,up.vol_uom
,row_number() OVER (PARTITION BY up.stlc, up.coltier, up.branding, up.accs, up.suffix ORDER BY item DESC) seq
,row_number() OVER (PARTITION BY up.stlc, up.coltier, up.branding, up.accs, up.suffix, up.pckg, up.col, up.vol_uom ORDER BY item DESC) seq
,item
FROM
unpivot up
@ -167,7 +167,10 @@ FROM
items
JOIN LATERAL rlarp.uom_array(conv) rslt ON true
)
--missing column 3
--SELECT * FROM unpivot ORDER BY stlc
--SELECT * FROM items_init where seq = 1
--SELECT * FROM items where seq = 1
----join conversion back to data initial part link------------------------------
SELECT
i.*
@ -181,3 +184,4 @@ WHERE
ORDER BY
stlc
,coltier
,col