Re: why the need for is null?

Поиск
Список
Период
Сортировка
Искать
От
Martijn van Oosterhout
Тема
Re: why the need for is null?
Дата
Msg-id
20040101222522.GB7723@svana.org
Ответ на
why the need for is null? (Baldur Norddahl)
Список
Дерево обсуждения
Re: why the need for is null? Christopher Browne <cbbrowne@acm.org>
Because in trivalued logic,  = NULL is also NULL. You need a
special operator to check if something is NULL, hence IS NULL and IS NOT
NULL. SQL standard says so.

This is a FAQ but I don't see it mentioned there.

On Thu, Jan 01, 2004 at 10:45:35PM +0100, Baldur Norddahl wrote:
> Hi,
> 
> How come "X=null" is not the same as "X is null"? I got a few selects with
> queries like this:
> 
> select * from foo where customer=#customer# or (#customer# is null and customer
> is null)
> 
> Without the last part, it will not correctly match null customers.
> 
> PS. I am using the ibatis framework for java, so the #customer# gets translated
> to ? and the whole thing made into a prepared statement.
> 
> Thanks,
> 
> Baldur
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly

-- 
Martijn van Oosterhout      http://svana.org/kleptog/
> (... have gone from d-i being barely usable even by its developers
> anywhere, to being about 20% done. Sweet. And the last 80% usually takes
> 20% of the time, too, right?) -- Anthony Towns, debian-devel-announce
В списке pgsql-general по дате отправления
От: Martijn van Oosterhout
Дата:
Сообщение: Re: GetLastInsertID ?
От: Tom Lane
Дата:
FAQ