swap out returning columns
This commit is contained in:
parent
fb7fdc7959
commit
f83746b892
@ -290,26 +290,29 @@ FROM
|
||||
INSERT INTO rlarp.osm_pool (SELECT * FROM pricing UNION ALL SELECT * FROM volume) RETURNING *
|
||||
)
|
||||
,insagg AS (
|
||||
SELECT
|
||||
SELECT
|
||||
---------customer info-----------------
|
||||
bill_cust_descr
|
||||
,billto_group
|
||||
,ship_cust_descr
|
||||
,shipto_group
|
||||
,quota_rep_descr
|
||||
,director_descr
|
||||
,director
|
||||
,segm
|
||||
,mod_chan
|
||||
,mod_chansub
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
,majg_descr
|
||||
,ming_descr
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,brand
|
||||
,part_family
|
||||
--,brand
|
||||
--,part_family
|
||||
,part_group
|
||||
,branding
|
||||
,color
|
||||
--,color
|
||||
,part_descr
|
||||
---------dates-------------------------
|
||||
,order_season
|
||||
,order_month
|
||||
,ship_season
|
||||
@ -319,33 +322,37 @@ SELECT
|
||||
,promo
|
||||
,version
|
||||
,iter
|
||||
--------values-------------------------
|
||||
,sum(value_loc) value_loc
|
||||
,sum(value_usd) value_usd
|
||||
,sum(cost_loc) cost_loc
|
||||
,sum(cost_usd) cost_usd
|
||||
,sum(units) units
|
||||
FROM
|
||||
FROM
|
||||
ins
|
||||
GROUP BY
|
||||
GROUP BY
|
||||
---------customer info-----------------
|
||||
bill_cust_descr
|
||||
,billto_group
|
||||
,ship_cust_descr
|
||||
,shipto_group
|
||||
,quota_rep_descr
|
||||
,director_descr
|
||||
,director
|
||||
,segm
|
||||
,mod_chan
|
||||
,mod_chansub
|
||||
,chan
|
||||
,chansub
|
||||
---------product info------------------
|
||||
,majg_descr
|
||||
,ming_descr
|
||||
,majs_descr
|
||||
,mins_descr
|
||||
,brand
|
||||
,part_family
|
||||
--,brand
|
||||
--,part_family
|
||||
,part_group
|
||||
,branding
|
||||
,color
|
||||
--,color
|
||||
,part_descr
|
||||
---------dates-------------------------
|
||||
,order_season
|
||||
,order_month
|
||||
,ship_season
|
||||
|
Loading…
Reference in New Issue
Block a user