Re: FW: "=" operator vs. "IS"

Поиск
Список
Период
Сортировка
От Michael Kleiser
Тема Re: FW: "=" operator vs. "IS"
Дата
Msg-id 40E180E5.40608@webde-ag.de
обсуждение исходный текст
Ответ на Re: FW: "=" operator vs. "IS"  (Rich Hall <rhall@micropat.com>)
Список pgsql-sql
NULL is handled like "unknow"

When you comparing something with an unknown value,
you are not able to say if they are equal or not.
So the result is also unknown.
The result NULL is correct.

If you whant to check if somethings is NULL
you have to use "(anything) IS NULL"



Rich Hall schrieb:
> My question is why is the form
> 
> "(anything) = NULL"
> 
> allowed?
> 
> Since
> 
> "(anything) = NULL" is always Null, this cannot be what the coder
> intended. 
> 
> This is much different when comparing two variables, where the coder may
> have to handle the cases where the variables are Null. Here the
> comparison is to a constant.
> 
> 
> 
> 
> Rick
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: FW: "=" operator vs. "IS"
Следующее
От: Alvaro Sanchez-Mariscal
Дата:
Сообщение: Unrecognized node type