query no cost
This commit is contained in:
parent
8525e9c12a
commit
82b0b10dfb
40
route_sql/build/test_cost.sql
Normal file
40
route_sql/build/test_cost.sql
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
WITH nc AS (
|
||||||
|
select
|
||||||
|
part
|
||||||
|
,plnt
|
||||||
|
, to_char(sum(fb_val_loc * r_rate),'9,999,999') sales
|
||||||
|
, to_char(sum(fb_qty),'9,999,999') units
|
||||||
|
from
|
||||||
|
rlarp.osm_fcpool
|
||||||
|
where
|
||||||
|
(
|
||||||
|
|
||||||
|
(
|
||||||
|
fb_qty <> 0
|
||||||
|
and coalesce(fb_cst_loc,0) = 0
|
||||||
|
)
|
||||||
|
or plnt is null
|
||||||
|
)
|
||||||
|
and version = 'b20'
|
||||||
|
group by
|
||||||
|
part
|
||||||
|
,plnt
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
nc.*
|
||||||
|
,v6stat
|
||||||
|
,coalesce(cgstcs, chstcs,y0stcs) stcs
|
||||||
|
FROM
|
||||||
|
nc
|
||||||
|
left outer join lgdat.stka ON
|
||||||
|
v6part = part
|
||||||
|
and v6plnt = plnt
|
||||||
|
left outer join lgdat.icstm ON
|
||||||
|
cgpart = part
|
||||||
|
and cgplnt = plnt
|
||||||
|
left outer join lgdat.icstp ON
|
||||||
|
chpart = part
|
||||||
|
and chplnt = plnt
|
||||||
|
left outer join lgdat.icstr ON
|
||||||
|
y0part = part
|
||||||
|
and y0plnt = plnt
|
Loading…
Reference in New Issue
Block a user