RE: [PEAR] Re: DB_DATAOBJECT extended join ...
| From: | Daniel Kopp | Date: | Mon, 01 Mar 2004 00:15:48 +0000 |
| Subject: | RE: [PEAR] Re: DB_DATAOBJECT extended join ... | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11026@lists.php.net to get a copy of this message | ||
Hi!
> eh.. - not quite sure what you are trying to do there...
>
> AFAIK - the on condition in the join will only do a single a=b.
sorry - I don't get that ...
> Daniel Kopp wrote:
> > Hi!
> >
> > Actually I wonder whether this is allowed but it works:
> > how can I do:
> >
> > SELECT * FROM table1
> > LEFT JOIN table2
> > ON (table1.foo = table2.foo AND table2.bar=$value)
> >
> > Does it have a name? Or is that called "wrong" or "bad style" or
> > "lucky that it works" or something?
What I want to do:
I want to get links from table1 to table2 but only if these links exist with
table2.bar set to a certain value.
If there is no such column I want to get it filled with NULL ... (different
from using WHERE which would not give back anything ...) As this works
nicely in mySQL I wonder how to get it in DB_DataObject
regards
Daniel