[Home] [Help]
MATERIALIZED VIEW: APPS.OPI_INV_TYP_ORG_MV
Source
SELECT sc.grp_id grp_id, it.inventory_type inventory_type, sc.time_id time_id, sc.organization_id organization_id, sc.item_org_id item_org_id, sc.inv_category_id inv_category_id, sc.year_id year_id, sc.qtr_id qtr_id, sc.month_id month_id, sc.week_id week_id, sc.day_id day_id, COUNT(*) count_total, SUM(DECODE(it.inventory_type, 'ONH', sc.onhand_value_g, 'INT', sc.intransit_value_g, 'WIP', sc.wip_value_g)) inv_value_g, COUNT(DECODE(it.inventory_type, 'ONH', sc.onhand_value_g, 'INT', sc.intransit_value_g, 'WIP', sc.wip_value_g)) count_i_v_g, SUM(DECODE(it.inventory_type, 'ONH', sc.onhand_value_b, 'INT', sc.intransit_value_b, 'WIP', sc.wip_value_b)) inv_value_b, COUNT(DECODE(it.inventory_type, 'ONH', sc.onhand_value_b, 'INT', sc.intransit_value_b, 'WIP', sc.wip_value_b)) count_i_v_b, sc.source source FROM OPI.OPI_DBI_INV_TYPE_CODES it, opi_inv_val_sum_mv sc WHERE sc.aggregation_level_flag = 0 GROUP BY sc.grp_id, it.inventory_type, sc.time_id, sc.organization_id, sc.item_org_id, sc.inv_category_id, sc.year_id, sc.qtr_id, sc.month_id, sc.week_id, sc.day_id, sc.source