Hi all,
i m using union query in asp page but that is taking morte time n slows down the server.
plz help me how can i overcome from this problem.this query is using many joins....this is urgent....
thanks
this is the query:-
select t.tid as tid, t.tenderno as tenderno,t.dt_publish as pubdt,wd.dt_submit as dts, t.dt_announce as pdt, t.flag as flag, wd.workno as workno, wd.title as title, l.name_org,cw.dt_submit as newdate, corrigendum =case when cw.workno is null then 0
else cw.workno end, cw.cno from tender t join workdesc wd on t.tid =wd.tid join login l on l.id =t.orgid left outer join (select tid, workno,dt_submit, max(corr_no) cno from corr_workdesc group by tid, workno, dt_submit) cw on wd.tid =cw.tid and wd.workno =cw.workno
where t.flag='Y'
union
select t.tid as tid,t.t_ref_no as tenderno,t.publish_date as pubdt,t.last_submit as dts,t.first_a_date as pdt,
t.flag as flag,t.workno as workno,t.t_title as title,l.name_org,cw.last_submit as newdate,
corrigendum =case when cw.workno is null then 0 else cw.workno end, cw.cno from tender_dtls t
join login l on l.name_org =t.orgname left outer join (select tid, workno,last_submit,
max(corrno) cno from corrigendum_dtls group by tid,workno,last_submit) cw on t.tid =cw.tid
and t.workno =cw.workno where t.flag='Y' order by pubdt desc,tid asc,workno,newdate asc