round before removing, keep any rows that have a qty, value, or cost

This commit is contained in:
Paul Trowbridge 2021-04-30 11:25:44 -04:00
parent 36d80dd296
commit e79c0d5bb4

View File

@ -553,13 +553,13 @@ SELECT * FROM baseline
,o.r_rate
,o.c_currency
,o.c_rate
,sum(o.fb_qty) fb_qty
,sum(o.fb_val_loc) fb_val_loc
,round(sum(o.fb_qty),2) fb_qty
,round(sum(o.fb_val_loc),2) fb_val_loc
,sum(o.fb_val_loc_dis) fb_val_loc_dis
,sum(o.fb_val_loc_qt) fb_val_loc_qt
,sum(o.fb_val_loc_pl) fb_val_loc_pl
,sum(o.fb_val_loc_tar) fb_val_loc_tar
,sum(o.fb_cst_loc) fb_cst_loc
,round(sum(o.fb_cst_loc),2) fb_cst_loc
,sum(o.fb_cst_loc_cur) fb_cst_loc_cur
,sum(o.fb_cst_loc_fut) fb_cst_loc_fut
,o.calc_status
@ -608,9 +608,9 @@ SELECT * FROM baseline
--,o.version
--,o.iter
HAVING
sum(o.fb_qty) <> 0
AND sum(o.fb_val_loc) <> 0
AND sum(o.fb_cst_loc) <> 0
round(sum(o.fb_qty),2) <> 0
OR round(sum(o.fb_val_loc),2) <> 0
OR round(sum(o.fb_cst_loc),2) <> 0
)
INSERT INTO rlarp.osmf_dev SELECT * FROM merge_diff;