From: | Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
---|---|
To: | David BOURIAUD <david(dot)bouriaud(at)ac-rouen(dot)fr> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Is this a feature ? |
Date: | 2002-06-04 08:32:13 |
Message-ID: | Pine.LNX.4.44.0206041119220.12372-100000@matrix.gatewaynet.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Tue, 4 Jun 2002, David BOURIAUD wrote:
I think is indeed is a feature!
Use coalesce.
> Hi the list !
> I've read the docs, and found that you could concatenate two or more strings
> in one select statement like this :
> select
> civ || name || forname as identity
> from
> person;
>
> This just works fine and returns rows with only one column named identity.
> So far, if one of the fields (civ, name or forname) is null, identity is
> null... That doesn't seems right, since it means that 1+2+0 = 0 !!!!
> Has anybody else seen the same strange behaviour ? And is there a way to work
> this around ?
> Please, don't answer me to use the function textcat (text, text), since it
> behaves the same and makes queries quite unreadeable...
> eg.
> select
> textcat ( textcat (civ, name), forname) as identity
> from person;
> is quite readeable, but when you add fields separator, it isn't.
>
--
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
tel: +30-10-8981112
fax: +30-10-8981877
email: achill(at)matrix(dot)gatewaynet(dot)com
mantzios(at)softlab(dot)ece(dot)ntua(dot)gr
From | Date | Subject | |
---|---|---|---|
Next Message | Oleg Bartunov | 2002-06-04 10:10:46 | Re: new itoar function |
Previous Message | Achilleus Mantzios | 2002-06-04 08:18:38 | new itoar function |