concatenation issue ( 8.4 )

From: Jonathan Vanasco <postgres(at)2xlp(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: concatenation issue ( 8.4 )
Date: 2009-09-18 15:52:02
Message-ID: 96D5F280-01FA-4F57-ACF4-0B5C4E5E6EE9@2xlp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table with
name_first
name_middle
name_last

if i try concatenating as such:
SELECT
name_first || ' ' || name_middle || ' ' || name_last
FROM
mytable
;

I end up with NULL as the concatenated string whenever any of the
referred fields contain a NULL value

I tried some text conversion and explicit casting , but that didn't work

What am I doing wrong ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2009-09-18 15:56:23 Re: pgadmin is changing pgpass.conf
Previous Message Raymond O'Donnell 2009-09-18 15:28:39 Re: pgadmin is changing pgpass.conf