DBA Data[Home] [Help]

MATERIALIZED VIEW: APPS.ENI_RES_3_MV

Source


select /* 12.0: bug#4526784 */
	mv1.resource_id
	,mv1.resource_code
	,mv1.bom_resource_type
	, mv1.organization_id
	, decode(mv2.number_resource, 1, -1, mv1.department_id) department_id
	, decode(mv2.number_resource,1,'Unassigned',mv1.department_code) department_code
	, nvl(mv1.resource_group,'-1') resource_group
	, mv1.unit_of_measure
	, mv1.disable_date
	, count(*) cnt
from   ENI_RES_1_MV mv1
, ENI_RES_2_MV mv2
where
	mv1.resource_id = mv2.resource_id
group by
	mv1.resource_id
	, mv1.resource_code
	,mv1.bom_resource_type
	, mv1.organization_id
	, decode(mv2.number_resource, 1, -1, mv1.department_id)
	, decode(mv2.number_resource,1,'Unassigned',mv1.department_code)
	, nvl(mv1.resource_group,'-1')
	, mv1.unit_of_measure
	,mv1.disable_date