Concatenating does not work properly

From: Michal Taborsky <M(dot)Taborsky(at)sh(dot)cvut(dot)cz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Concatenating does not work properly
Date: 2003-04-09 14:14:41
Message-ID: b719sp$24ki$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

I am facing a problem I cannot really explain to myself. I have a table
with personal data which has columns surname, firstname, secondname,
title and I want to do a simple select like this:

SELECT (surname || ', ' || firstname || ' ' || secondname) as fullname
FROM person

For some rows (from what I recognised it is with rows, which have the
title column empty) it works, for some it returns empty string:

akcent=# SELECT (surname || ', ' || firstname || ' ' || secondname) as
fullname, title_pre, surname, firstname, secondname FROM person;

fullname | title_pre | surname | firstname | secondname
-----------------------+-----------+----------+-----------+------------
| Ing. | Taborsky | Michal |
| Ing. | Barta | David |
Novak, Josef | | Novak | Josef |
Saroch, Adrian Walter | | Saroch | Adrian | Walter
(4 rows)

Is that a bug or am I missing something ?

Thanks,
Michal

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michal Taborsky 2003-04-09 14:54:50 Concatenating not working properly
Previous Message Charles McClain 2003-04-09 13:28:18 unsubscribe