Re: How to retrieve rows with empty value in numeric(12,8) columns - Mailing list pgsql-general

From Alban Hertroys
Subject Re: How to retrieve rows with empty value in numeric(12,8) columns
Date
Msg-id CAF-3MvNCNkKa=zXCJEPTuk5rTkZjWCmBdVywSdLTFiy1ouwUeg@mail.gmail.com
Whole thread Raw
In response to Re: How to retrieve rows with empty value in numeric(12,8) columns  (Adarsh Sharma <adarsh.sharma@orkash.com>)
List 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 by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: How to retrieve rows with empty value in numeric(12,8) columns
Next
From: Bèrto ëd Sèra
Date:
Subject: Re: How to retrieve rows with empty value in numeric(12,8) columns