472,122 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,122 software developers and data experts.

Help in Query

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
Jul 11 '07 #1
0 928

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by James | last post: by
9 posts views Thread by netpurpose | last post: by
9 posts views Thread by Dom Boyce | last post: by
5 posts views Thread by Steve Patrick | last post: by
6 posts views Thread by Takeadoe | last post: by
47 posts views Thread by Jo | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.