[ILUG] MySQL & outer joins...
McLoughlin, Mark
mark.mcloughlin at intel.com
Tue Sep 12 09:39:18 IST 2000
-----Original Message-----
From: John P . Looney [mailto:valen at tuatha.org]
Sent: 11 September 2000 21:12
To: Irish LUG list
Just wondering...
> I assume that mySQL doesn't accpt the oracle syntax for an outer join -
>something like (+) IIRC.
>
> I was trying to do:
>
> SELECT table1.usern as user,
> table2.fname as folder
> table3.comment as comment
> from table1, table2, table3
> WHERE table1.usern = 'user' and
> (table2.ind = table1.2ind or table1.2ind = NULL) and
> (table3.ind = table1.3ind or table1.3ind = NULL);
>
> The idea being that sometimes table1.2ind or table1.3ind can be null, so
>I want anything taken from that table to be null. And MySQL isn't
>impressed with me ;)
I think whats doing on here is that with a join you have to have a common
field, that links the tables together. Now, you have that with
'WHERE table2.ind = table1.2ind AND table3.ind = table1.3ind'
But, if they are table1.2ind or table1.3ind are NULL that common linkage
doesn't exist.
- Mark
More information about the ILUG
mailing list