Quinten Steenhuis wrote:

> Sql, query
>
> > Hi,
> >
> > I have a field that I need to do a join on. Unfortunately, the column is
> > allowed to be null (and it should be). My plan is to return the literal
> > string 'None' if the column is null, and otherwise to return the joined
> > value. How can I do this, when the inner join that I want will exclude the
> > rows where the column in question is null?
> >
> > eg:
> >
> > SELECT
> > ... as 'Motion Ref.', title as
> > Title,
> > IF(IFNULL(o.name,1<0),CONCAT('None'),o.name) as Organization,
> > ... as Date FROM m,o
> > WHERE (o.ID = m.organization)
> >
> > Quinten
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Quinten,

]Look at "outer joins". It might help.

http://www.mysql.com/doc/en/JOIN.html

walt


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to