Re: select NULL||'abc' returns empty string (or NULL)

Поиск
Список
Период
Сортировка
От Alexey Borzov
Тема Re: select NULL||'abc' returns empty string (or NULL)
Дата
Msg-id 17476118372.20020227145653@rdw.ru
обсуждение исходный текст
Ответ на select NULL||'abc' returns empty string (or NULL)  (Holger Marzen <holger@marzen.de>)
Список pgsql-general
Greetings, Holger!

At 27.02.2002, 14:25, you wrote:
HM> I suppose that PostgreSQL insists that a NULL value cannot be
HM> concatenated with a string. Can I cast this somehow? I noticed that
HM> feature when I did a

HM> select * from tab where col1||col2 ilike '%bla%'

HM> and it did't find rows where one of the columns was NULL. Any ideas for
HM> workarounds?
    Yes:
    SELECT * FROM tab WHERE coalesce(col1, '')||coalesce(col2, '') ILIKE '%bla%';

--
Yours, Alexey V. Borzov, Webmaster of RDW.ru



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

Предыдущее
От: Holger Marzen
Дата:
Сообщение: select NULL||'abc' returns empty string (or NULL)
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: select NULL||'abc' returns empty string (or NULL)