Re:

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re:
Дата
Msg-id Pine.LNX.4.30.0203111138320.690-100000@peter.localdomain
обсуждение исходный текст
Ответ на ...  (Bhuvan A <bhuvansql@yahoo.com>)
Список pgsql-bugs
Bhuvan A writes:

> > If you compare a NULL with anything you don't get a true value whether
> > you're comparing with =, !=, <, >, etc...  That's how it's defined to
> > behave.
>
> where did you get this definition of behaviour!? is it applicable only to
> postgres or ..?  its quite strange yaar!

It's how the SQL standard defines it.  If other database software claims
to comply to SQL it should also behave that way.  (Before you complain
about the SQL standard, its definition was adopted from the common
mathematical notion of three-valued Boolean logic.)

If you want

   a <> b

to return true if one of a and b is NULL and the other is not NULL then
you will have to do a bit more work.  For example,

   (a <> b) or (a is null and b is not null) or (a is not null and b is null)

--
Peter Eisentraut   peter_e@gmx.net

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

Предыдущее
От: Yury Bokhoncovich
Дата:
Сообщение: Re:
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: