RE: Newbie question on SQL
Posted in 2001
I have never seen the outer with two arguments.
Try:
SELECT a.a1, b.b1, c.c1 FROM a_table a, OUTER b_table b, OUTERc_table c
WHERE a.a1=b.b1 AND b.b1=c.c1
Does the process hang, or does it run forever ??
Check by doing :
ps -eaf | grep dbaccess
and check if the process is running and using many seconds of cpu
time.
If that is the case then perhaps you are trying to join 3 very large
tables.
Do the tables have indexes?? Perhaps add indexes on the fields you
are searching on. ie
create unique index a_ind0 on a ( a1 ) ; do this on all tables. If this field is not unique, then drop the
word unique.
You my wish to divide this sql into two parts ie :
SELECT a.a1, b.b1 FROM a_table a, OUTER b_table b
WHERE a.a1=b.b1
into temp ab ; SELECT ab.*, c.c1 FROM ab, OUTER c_table c
WHERE ab.b1=c.c1
I hope this helps.
Isaac
__________________________________
Isaac Loven. Melbourne. Australia
_________________________________________________________