On Wednesday 14 May 2008 18:02:42 Olexandr Melnyk wrote:
> It doesn't return no rows, it returns row(s) with a single column set to a
> NULL value. In case one of the arguments is NULL, CONCAT() will return
> NULL.
>
> To replace the value of one of the fields with an empty string when it's
> NULL, you can use something like: CONCAT(COAESCE(a, ''), ' ', COAESCE(b,
> ''))

or CONCAT_WS IIRC

W
>
> On 5/14/08, Afan Pasalic <[EMAIL PROTECTED]> wrote:
> > hi,
> >
> > I have query
> > SELECT CONCAT(r.first_name, ' ', r.last_name, '\n', r.organization, '\n',
> > r.title, '\n', a.address1, '\n', a.city, ', ', a.state, ' ', a.zip, '\n',
> > r.email)
> > FROM registrants r, addresses a
> > WHERE r.reg_id=121
> >
> > if any of columns has value (e.g. title) NULL, I'll get as result 0
> > records.
> > If query doesn't have concat() - it works fine.
> >
> > Why is that?
> >
> > -afan
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to