Re: IN query operator and NULL values

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: IN query operator and NULL values
Дата
Msg-id 659A86E2-FF56-4173-81C3-6E71C69F56A5@solfertje.student.utwente.nl
обсуждение исходный текст
Ответ на Re: IN query operator and NULL values  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Список pgsql-general
On May 16, 2008, at 6:54 PM, Alban Hertroys wrote:

> development=> select b, coalesce( (b in (1, null))::text, 'NULL')
> from test;
>  b | coalesce
> ---+----------
>  1 | true
>  2 | NULL
>    | NULL
> (3 rows)

Just remembered a nice option from psql that doesn't quite clutter my
example as much:

development=> \pset null '<NULL>'
Null display is "<NULL>".
development=> select b, b in (1, null) from test;
    b    | ?column?
--------+----------
       1 | t
       2 | <NULL>
  <NULL> | <NULL>
(3 rows)


Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,482dbd32927664852116061!



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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: IN query operator and NULL values
Следующее
От: Andy Anderson
Дата:
Сообщение: Re: IN query operator and NULL values