Re: How to retrieve rows with empty value in numeric(12,8) columns

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: How to retrieve rows with empty value in numeric(12,8) columns
Дата
Msg-id CAF-3MvNCNkKa=zXCJEPTuk5rTkZjWCmBdVywSdLTFiy1ouwUeg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to retrieve rows with empty value in numeric(12,8) columns  (Adarsh Sharma <adarsh.sharma@orkash.com>)
Список pgsql-general
On 6 December 2011 12:00, Adarsh Sharma <adarsh.sharma@orkash.com> wrote:
>> select * from table where lat IS NULL;

> can you explain how it works or any link that explain the difference between
> 2 queries.

That's because of the 3-valued logic of SQL.
  x=NULL always evaluates to NULL, because it is unknown whether the
two might be equal or not.
  x IS NULL checks whether x is known (NOT NULL) or not (NULL) and
evaluates to TRUE or FALSE based on that.

WHERE-clauses only return rows where the expression evaluates to TRUE
and not rows where it evaluates to NULL or (obviously) FALSE.

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

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: How to retrieve rows with empty value in numeric(12,8) columns
Следующее
От: Bèrto ëd Sèra
Дата:
Сообщение: Re: How to retrieve rows with empty value in numeric(12,8) columns