DBA Data[Home] [Help]

MATERIALIZED VIEW: APPS.BIM_I_ORD_INT_MV

Source


SELECT /* Dummy Comment */
    1 umark
    ,a.transaction_create_date  transaction_create_date
    ,a.source_code_id source_code_id
    ,a.object_id object_id
    ,a.object_type object_type
    ,a.vbh_category_id  vbh_category_id
    ,'ORDER' metric_type
    ,a.child_object_id child_object_id
    ,a.child_object_type child_object_type
    ,a.object_region object_region
    ,a.object_country object_country
    ,a.object_status object_status
    ,a.activity_id activity_id
    ,'Y' category_flag
   ,sum(a.booked_amt_f) booked_amt_f
   ,count(a.booked_amt_f) booked_amt_f_c
   ,sum(a.invoiced_amt_f) invoiced_amt_f
   ,count(a.invoiced_amt_f) invoiced_amt_f_c
   ,sum(a.booked_amt_s) booked_amt_s
   ,count(a.booked_amt_s) booked_amt_s_c
   ,sum(a.invoiced_amt_s) invoiced_amt_s
   ,count(a.invoiced_amt_s) invoiced_amt_s_c
   ,count(*) all_c
FROM   BIM_I_ORD_COL_MV a,
       ENI.ENI_DENORM_HIERARCHIES d,
       INV.MTL_DEFAULT_CATEGORY_SETS e
WHERE
       a.vbh_category_id = d.child_id
       and d.parent_id = nvl(a.primary_category_id ,-1)
       AND    d.object_id = e.category_set_id
       AND    d.object_type = 'CATEGORY_SET'
       AND    e.functional_area_id = 11
       AND    d.dbi_flag = 'Y'
GROUP BY a.transaction_create_date
         ,a.source_code_id
         ,a.object_id
	 ,a.object_type
	 ,a.vbh_category_id
	 ,a.child_object_id
         ,a.child_object_type
	 ,a.object_region
	 ,a.object_country
	 ,a.object_status
         ,a.activity_id