DBA Data[Home] [Help]

MATERIALIZED VIEW: APPS.ISC_DBI_PM_0000_MV

Source


SELECT	/* 12.0: bug#4526784 */
	 	fact.snapshot_id							SNAPSHOT_ID,
		fact.organization_id							ORGANIZATION_ID,
		fact.sr_supplier_id 							SR_SUPPLIER_ID,
		(star.inventory_item_id||'-'||star.organization_id)			ITEM_ID,
		nvl(star.inv_category_id, -1) 						ITEM_CATEGORY_ID,
		grouping_id(fact.snapshot_id,
			fact.organization_id,
			fact.sr_supplier_id,
			(star.inventory_item_id||'-'||star.organization_id),
			nvl(star.inv_category_id, -1),
			fact.start_date,
			fact.period_type_id) 						GRP_ID,
		grouping_id(nvl(star.inv_category_id, -1),
			(star.inventory_item_id||'-'||star.organization_id)) 		ITEM_CAT_FLAG,
		fact.start_date 							START_DATE,
		fact.period_type_id 							PERIOD_TYPE_ID,
		sum(fact.purchasing_cost) 						PURCHASING_COST,
		count(fact.purchasing_cost) 						PURCHASING_COST_CNT,
		sum(fact.purchasing_cost_g) 						PURCHASING_COST_G,
		count(fact.purchasing_cost_g) 						PUR_COST_G_CNT,
		sum(fact.purchasing_cost_g1) 						PURCHASING_COST_G1,
		count(fact.purchasing_cost_g1) 						PUR_COST_G1_CNT,
		count(*) 								CNT
	   FROM	ISC.ISC_DBI_SUPPLIES_SNAPSHOTS 	fact,
		ENI.ENI_OLTP_ITEM_STAR 		star
	  WHERE	fact.sr_inventory_item_id = star.inventory_item_id
	    AND	fact.organization_id = star.organization_id
	GROUP BY fact.snapshot_id,
		fact.organization_id,
		fact.sr_supplier_id,
		rollup(nvl(star.inv_category_id,-1),
			(star.inventory_item_id||'-'||star.organization_id)),
		fact.start_date,
		fact.period_type_id