DBA Data[Home] [Help]

VIEW: APPS.DDR_BS_BU_ITM_ASSC_WK_MV#

Source

View Text - Preformatted

select assoc.MFG_ORG_CD
,      assoc.RTL_ORG_CD
,      assoc.RTL_BSNS_UNIT_ID
,      mfghier.MFG_ITEM_ID
,      timehier.BSNS_WK_ID
,      count(*) as TOTAL_BU_ITM_DAYS
from   ddr_r_item_bsns_unt_assc      assoc
,      ddr_r_base_day_dn_mv          timehier
,      ddr_r_mfg_item_sku_dn_mv      mfghier
where timehier.mfg_org_cd = assoc.mfg_org_cd
and   timehier.clndr_cd = CONCAT(assoc.mfg_org_cd, '-BSNS')
and   timehier.clndr_dt between nvl(assoc.eff_from_dt, to_date('01-JAN-1900')) and nvl(assoc.eff_to_dt, to_date('31-DEC-9999'))
and   mfghier.mfg_sku_item_id = assoc.mfg_sku_item_id
group by assoc.MFG_ORG_CD
,        assoc.RTL_ORG_CD
,        assoc.RTL_BSNS_UNIT_ID
,        mfghier.MFG_ITEM_ID
,        timehier.BSNS_WK_ID

View Text - HTML Formatted

SELECT ASSOC.MFG_ORG_CD
, ASSOC.RTL_ORG_CD
, ASSOC.RTL_BSNS_UNIT_ID
, MFGHIER.MFG_ITEM_ID
, TIMEHIER.BSNS_WK_ID
, COUNT(*) AS TOTAL_BU_ITM_DAYS FROM DDR_R_ITEM_BSNS_UNT_ASSC ASSOC
, DDR_R_BASE_DAY_DN_MV TIMEHIER
, DDR_R_MFG_ITEM_SKU_DN_MV MFGHIER WHERE TIMEHIER.MFG_ORG_CD = ASSOC.MFG_ORG_CD AND TIMEHIER.CLNDR_CD = CONCAT(ASSOC.MFG_ORG_CD
, '-BSNS') AND TIMEHIER.CLNDR_DT BETWEEN NVL(ASSOC.EFF_FROM_DT
, TO_DATE('01-JAN-1900'))
AND NVL(ASSOC.EFF_TO_DT
, TO_DATE('31-DEC-9999')) AND MFGHIER.MFG_SKU_ITEM_ID = ASSOC.MFG_SKU_ITEM_ID GROUP BY ASSOC.MFG_ORG_CD
, ASSOC.RTL_ORG_CD
, ASSOC.RTL_BSNS_UNIT_ID
, MFGHIER.MFG_ITEM_ID
, TIMEHIER.BSNS_WK_ID