Hi,
I have the following query.
select distinct a.*,b.launch_dt
from
(
select
list_id,
run_seq,
resp_dt,
sum(udl_count),
sum(ecu_count),
sum(clk_count),
sum(coa_count),
grp_cd,
sum(taf_count),
sum(opn_count),
sum(usb_count),
site_cd
from
(SELECT
list_id,
run_seq,
resp_cd,
to_char(resp_dt,'dd-mon-yy') resp_dt,
decode(resp_cd,'UDL',count(resp_cd),0) udl_count,
decode(resp_cd,'ECU',count(resp_cd),0) ecu_count,
decode(resp_cd,'CLK',count(resp_cd),0) clk_count,
decode(resp_cd,'COA',count(resp_cd),0) coa_count,
grp_cd,
decode(resp_cd,'TAF',count(resp_cd),0) taf_count,
decode(resp_cd,'OPN',count(resp_cd),0) opn_count,
decode(resp_cd,'USB',count(resp_cd),0) usb_count,
site_cd
FROM GCA_CBX_RESP_DAILY_AGGR
GROUP BY
resp_cd,
list_id,
run_seq,
to_char(resp_dt,'dd-mon-yy'),
site_cd,
grp_cd
order by resp_dt desc
)
group by
list_id,
run_seq,
resp_dt,
site_cd,
grp_cd) a,gca_program_run_hist b
where a.list_id=b.list_id and a.run_seq=b.campaign_run_seq;
In the above query i have used some in line views which will decrease the query performance.
Please give me some idea to increase the performance of the query.
Thanks,
Dilip