[Home] [Help]
MATERIALIZED VIEW: APPS.ISC_TRN_006_MV
Source
SELECT /* 12.0: bug#4526784 */ its.carrier_id CARRIER_ID, its.mode_of_transport MODE_OF_TRANSPORT, its.service_level SERVICE_LEVEL, grouping_id(service_level, carrier_id) AGG_LEVEL, grouping_id(its.carrier_id, its.mode_of_transport, its.service_level, cal.ent_qtr_id, cal.ent_period_id, cal.week_id, cal.report_date_julian) GRP_ID, decode(grouping_id(cal.ent_qtr_id, cal.ent_period_id, cal.week_id, cal.report_date_julian), 14,cal.report_date_julian,13,cal.week_id, 11,cal.ent_period_id,7,cal.ent_qtr_id) TIME_ID, decode(grouping_id(cal.ent_qtr_id,cal.ent_period_id,cal.week_id,cal.report_date_julian), 14,1,13,16,11,32,7,64) PERIOD_TYPE_ID, cal.report_date_julian DAY_ID, cal.week_id WEEK_ID, cal.ent_period_id ENT_PERIOD_ID, cal.ent_qtr_id ENT_QTR_ID, sum(decode(stop_rank, 1, trip_freight_cost_g, 0)) FREIGHT_COST_G, count(decode(stop_rank, 1, trip_freight_cost_g, 0)) FREIGHT_COST_G_CNT, sum(decode(stop_rank, 1, trip_freight_cost_g1, 0)) FREIGHT_COST_G1, count(decode(stop_rank, 1, trip_freight_cost_g1, 0)) FREIGHT_COST_G1_CNT, sum(its.distance_to_next_stop_g) FREIGHT_DISTANCE_G, count(its.distance_to_next_stop_g) FREIGHT_DISTANCE_G_CNT, count(*) CNT FROM ISC.ISC_DBI_TRIP_STOPS_F its, FII.FII_TIME_DAY cal WHERE its.time_init_dept_date_id = cal.report_date AND its.trip_freight_cost_g IS NOT NULL AND its.distance_to_next_stop_g IS NOT NULL GROUP BY mode_of_transport, rollup(carrier_id), rollup(service_level), grouping sets(cal.ent_qtr_id, cal.ent_period_id, cal.week_id, cal.report_date_julian)