[Home] [Help]
Skip to content
MATERIALIZED VIEW: APPS.DDR_BS_FRCST_LST_SLS_MV
Source
select frcst.MFG_ORG_CD
, frcst.RTL_ORG_CD
, frcst.ORG_BSNS_UNIT_ID
, frcst.MFG_SKU_ITEM_ID
, frcst.RTL_SKU_ITEM_ID
, frcst.DAY_CD
, maxvrsn.MAX_FRCST_VRSN
, decode(sign(nvl(sls.SLS_AMT_RPT, 0)), 1, frcst.FRCST_SLS_AMT_RPT, 0) as ACT_FRCST_SLS_AMT_RPT
, decode(sign(nvl(sls.SLS_QTY_PRMRY, 0)), 1, frcst.FRCST_SLS_QTY_PRMRY, 0) as ACT_FRCST_SLS_QTY_PRMRY
, frcst.ROWID as FRCST_ROWID
, maxvrsn.ROWID as MAXVRSN_ROWID
, sls.ROWID as SLS_ROWID
from ddr_b_sls_frcst_item_day frcst
, ddr_bs_frcst_vrsn_mv maxvrsn
, ddr_b_rtl_sl_rtn_itm_day sls
where maxvrsn.mfg_org_cd = frcst.mfg_org_cd
and maxvrsn.rtl_org_cd = frcst.rtl_org_cd
and maxvrsn.org_bsns_unit_id = frcst.org_bsns_unit_id
and maxvrsn.glbl_item_id = frcst.glbl_item_id
and maxvrsn.glbl_item_id_typ = frcst.glbl_item_id_typ
and maxvrsn.rtl_sku_item_id = frcst.rtl_sku_item_id
and maxvrsn.day_cd = frcst.day_cd
and maxvrsn.max_frcst_vrsn = frcst.frcst_vrsn
and frcst.mfg_org_cd = sls.mfg_org_cd (+)
and frcst.rtl_org_cd = sls.rtl_org_cd (+)
and frcst.org_bsns_unit_id = sls.org_bsns_unit_id (+)
and frcst.day_cd = sls.day_cd (+)
and frcst.glbl_item_id = sls.glbl_item_id (+)
and frcst.rtl_sku_item_id = sls.rtl_sku_item_id (+)