concatenating with NULLs

From: Seb <spluque(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: concatenating with NULLs
Date: 2011-04-25 21:13:03
Message-ID: 87vcy2qbkw.fsf@kolob.sebmags.homelinux.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

A query such as:

SELECT 'a' || 'b' || NULL;

returns a NULL. How can I ensure I get 'ab' in the result? I'm trying
to concatenate columns and one of them might have NULL values, which I
simply want to ignore.

Cheers,

--
Seb

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bosco Rama 2011-04-25 22:24:59 Re: concatenating with NULLs
Previous Message Nicholson, Brad (Toronto, ON, CA) 2011-04-25 20:54:22 Re: 10 missing features