Re: string is sometimes null ?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: string is sometimes null ?
Дата
Msg-id 415BD15D.1060007@archonet.com
обсуждение исходный текст
Ответ на Re: string is sometimes null ?  (Graeme Hinchliffe <graeme.hinchliffe@zeninternet.co.uk>)
Список pgsql-general
Graeme Hinchliffe wrote:
>>If monthcurr or username are null, the above will be null.
>>Anything || NULL => NULL.
>
> AH! thanks sorted it now.  That is not the behaviour I would have
> expected :)
>
> Is there a concatination operator that will not do this? IE
> if
> var1 || var2 || var3
>
> and var2 is null would result in just var1var3  ?

You could use coalesce(var1,'') || coalesce(var2,'')
Or, wrap that in your own function and create your own operator.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Graeme Hinchliffe
Дата:
Сообщение: Re: string is sometimes null ?
Следующее
От: Holger Klawitter
Дата:
Сообщение: Re: string is sometimes null ?