couple minor issues
This commit is contained in:
parent
a83708a7ca
commit
c602564cb7
@ -193,6 +193,7 @@ SELECT
|
|||||||
o.plnt
|
o.plnt
|
||||||
--promo in next step
|
--promo in next step
|
||||||
--terms in next step
|
--terms in next step
|
||||||
|
,c.bvterm terms
|
||||||
,o.bill_cust_descr
|
,o.bill_cust_descr
|
||||||
,o.ship_cust_descr
|
,o.ship_cust_descr
|
||||||
,o.dsm
|
,o.dsm
|
||||||
@ -220,11 +221,14 @@ SELECT
|
|||||||
,sum(coalesce(o.units,0)) units
|
,sum(coalesce(o.units,0)) units
|
||||||
,sum(coalesce(o.value_loc,0)) value_loc
|
,sum(coalesce(o.value_loc,0)) value_loc
|
||||||
,sum(coalesce(o.value_usd,0)) value_usd
|
,sum(coalesce(o.value_usd,0)) value_usd
|
||||||
,sum(coalesce(o.cost_loc,0)) cost_usd
|
,sum(coalesce(o.cost_loc,0)) cost_loc
|
||||||
|
,sum(coalesce(o.cost_usd,0)) cost_usd
|
||||||
,o.calc_status
|
,o.calc_status
|
||||||
,o.flag
|
,o.flag
|
||||||
FROM
|
FROM
|
||||||
rlarp.osm_pool o
|
rlarp.osm_pool o
|
||||||
|
LEFT OUTER JOIN lgdat.cust c ON
|
||||||
|
c.bvcust = rtrim(substr(o.bill_cust_descr,1,8))
|
||||||
WHERE
|
WHERE
|
||||||
-----------------scenario----------------------------
|
-----------------scenario----------------------------
|
||||||
where_clause
|
where_clause
|
||||||
@ -239,6 +243,7 @@ SELECT
|
|||||||
GROUP BY
|
GROUP BY
|
||||||
--fspr in next step
|
--fspr in next step
|
||||||
o.plnt
|
o.plnt
|
||||||
|
,c.bvterm
|
||||||
--promo in next step
|
--promo in next step
|
||||||
--terms in next step
|
--terms in next step
|
||||||
,o.bill_cust_descr
|
,o.bill_cust_descr
|
||||||
@ -334,6 +339,7 @@ FROM
|
|||||||
CROSS JOIN vscale s
|
CROSS JOIN vscale s
|
||||||
CROSS JOIN mmixp m
|
CROSS JOIN mmixp m
|
||||||
CROSS JOIN closest
|
CROSS JOIN closest
|
||||||
|
CROSS JOIN log
|
||||||
LEFT OUTER JOIN mseq ON
|
LEFT OUTER JOIN mseq ON
|
||||||
mseq.m = closest.m
|
mseq.m = closest.m
|
||||||
LEFT OUTER JOIN gld od ON
|
LEFT OUTER JOIN gld od ON
|
||||||
@ -367,9 +373,9 @@ WHERE
|
|||||||
)
|
)
|
||||||
,price AS (
|
,price AS (
|
||||||
SELECT
|
SELECT
|
||||||
sd.fspr
|
b.fspr
|
||||||
,b.plnt
|
,b.plnt
|
||||||
,m.promo
|
,b.promo
|
||||||
,b.terms
|
,b.terms
|
||||||
,b.bill_cust_descr
|
,b.bill_cust_descr
|
||||||
,b.ship_cust_descr
|
,b.ship_cust_descr
|
||||||
@ -419,6 +425,7 @@ sd.fspr
|
|||||||
FROM
|
FROM
|
||||||
volume b
|
volume b
|
||||||
CROSS JOIN pscale p
|
CROSS JOIN pscale p
|
||||||
|
CROSS JOIN log
|
||||||
WHERE
|
WHERE
|
||||||
p.factor <> 0 or p.mod_price <> 0
|
p.factor <> 0 or p.mod_price <> 0
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user