Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6 December 2011 12:00, Adarsh Sharma <adarsh.sharma@xxxxxxxxxx> 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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux