Re: Queries and Subqueries
From: Frenchy461 <frenchy461_at_aol.com>
Date: 1996/10/22
Message-ID: <54jup8$b1_at_newsbf02.news.aol.com>#1/1
Date: 1996/10/22
Message-ID: <54jup8$b1_at_newsbf02.news.aol.com>#1/1
I spent about a full day trying to figure this out but I can't remember why(I could if I tried to but I don't want to right now). For some reason when there is a lot of rows involved in a concatenation of queries, the combined query has a problem handling (+). Intsead, try and use unions with the combination of NOT EXISTS in each of the select. If you have more than two tables, you must all possible combinations. I did it with 6 tables. It speeded the query up to instantly. Send me a note if it works.
create view view_master
select .....
from VIEWA A, VIEWB B
where A.acct1 = B.acct1
and A.acct2 = B.acct2 (No (+))
and A.acct3 = B.acct3
union
select .....
from VIEWA A
where not exists
(select .....
from VIEWB B
where A.acct1 = B.acct1
and A.acct2 = B.acct2
and A.acct3 = B.acct3);
Received on Tue Oct 22 1996 - 00:00:00 CEST
