Re: case not sensitive to null condition ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: case not sensitive to null condition ?
Дата
Msg-id 3476.1367332941@sss.pgh.pa.us
обсуждение исходный текст
Ответ на case not sensitive to null condition ?  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Список pgsql-general
"Gauthier, Dave" <dave.gauthier@intel.com> writes:
> thedb=# select
>   ''''||bicolumn||'''',
>   coalesce(permitted_values,'is_null'),
>   case permitted_values when NULL then 'null' else ''''||permitted_values||'''' end
>    from bi_constraints limit 2;

That's equivalent to "case when permitted_values = NULL then ..." which
doesn't work, because = never succeeds on nulls.  You need to write
something like "case when permitted_values IS NULL then ...".

            regards, tom lane


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

Предыдущее
От: Lutz Fischer
Дата:
Сообщение: Re: Windows query weird result
Следующее
От: Andrew Hastie
Дата:
Сообщение: zLinux Load Testing Experience