Re: how to return field based on field= NULL or not

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: how to return field based on field= NULL or not
Дата
Msg-id 20090824112602.GI5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: how to return field based on field= NULL or not  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Список pgsql-general
On Mon, Aug 24, 2009 at 12:54:31PM +0200, Alban Hertroys wrote:
>     CASE
>     WHEN fieldA IS NOT NULL THEN fieldA
>     WHEN fieldB IS NOT NULL THEN fieldB
>     WHEN fieldC IS NOT NULL THEN fieldC
>     ELSE fieldD
>     END

BTW, the above expression is identical to:

  COALESCE(fieldA,fieldB,fieldC,fieldD)

--
  Sam  http://samason.me.uk/

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: how to return field based on field= NULL or not
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Multiple table entries?