RE: Outer join question
Posted in 1998
----------
From: Guillermo Labatte[SMTP:labatteg@usa.net]
Sent: Friday, February 13, 1998 5:28 AM
I'm using Online 5.07
I issue the command ...
select * from table_A,outer table_B
where table_A.x=table_B.y
into temp table_C;
select * from table_C where y is null
and it returns a different result from
select * from table_A,outer table_B
where table_A.x=table_B.y and
table_B is null;
Why?
<RANT>
Because it has always been defined to behave differently.
I think the definition of OUTER JOIN is obnoxious, precisely because of this
discrepancy, but I raised this issue a long time ago (5-10 years ago!), and
it was defined that the observed behaviour was the correct behaviour by documenting
it in a Tech Notes article.
</RANT>
In short, be very careful with OUTER joins because the behaviour you observe is
defined to be correct but is anything but intuitive. My 'Using Informix-SQL' book
tries to explain this. C J Date comments adversely on my description of it (and
also the implementation I'm describing) in one of his 'Selected Writings' books
(I think it's the 90-94 one).
Yours,
Jonathan Leffler (jleffler@visa.com) #include <sphinx.h>