Concatenation containing a "null" term

Поиск
Список
Период
Сортировка
От Pierre Thibaudeau
Тема Concatenation containing a "null" term
Дата
Msg-id 74b035bb0605281417x5fcfc69t6a1def25c193a02d@mail.gmail.com
обсуждение исходный текст
Ответы Re: Concatenation containing a "null" term  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-novice
(I am certain I once saw the answer to the following question, but I can't for the life of me find out where!)

I create a View as

SELECT (firstname || ' ' || lastname)::character(50) AS fullname
FROM name_table;

firstname and lastname are text columns, and firstname may be null.

Unfortunately, it seems that whenever firstname is null, the resulting fullname is null also.  Is there a way of having the null-strings terms of the concatenation operator be considered as empty strings instead?

Thanks for the help!

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: SQL Question - S/B Good...
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Concatenation containing a "null" term