concatenation with a null column (using ||) nulls the result?

Поиск
Список
Период
Сортировка
От Neil Harkins
Тема concatenation with a null column (using ||) nulls the result?
Дата
Msg-id Pine.SOL.4.10.10604101430250.2779-100000@well.com
обсуждение исходный текст
Ответы Re: concatenation with a null column (using ||) nulls the result?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: concatenation with a null column (using ||) nulls the result?  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: concatenation with a null column (using ||) nulls the  (Ross Johnson <ross.johnson@homemail.com.au>)
Список pgsql-sql
inventory=> SELECT cabinets_name, cabinets_description 
FROM cabinets WHERE cabinets_datacenters = 2;cabinets_name | cabinets_description
---------------+----------------------548-4th-Cab2  |548-4th-RR1   |548-4th-RR2   |548-4th-Cab1  |
(4 rows)

inventory=> SELECT cabinets_name || ' - ' || cabinets_description AS concat 
FROM cabinets WHERE cabinets_datacenters = 2;    concat
-----------------


548-4th-Cab1 -
(4 rows)

Note: The cabinets_description for the "548-4th-Cab1" row is " ", 
not NULL, hence it being displayed. Is this standard SQL behavior? 

Client is from rpm: postgresql-8.0.7-1.FC4.1
Server is from rpm: postgresql-server-8.0.7-1.FC4.1

-neil




В списке pgsql-sql по дате отправления:

Предыдущее
От: Markus Schaber
Дата:
Сообщение: Re: have you feel anything when you read this ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: concatenation with a null column (using ||) nulls the result?