Re: "IS NOT NULL" != "NOT NULL" - Mailing list pgsql-general

From Tom Lane
Subject Re: "IS NOT NULL" != "NOT NULL"
Date
Msg-id 23060.1011476798@sss.pgh.pa.us
Whole thread Raw
In response to Re: "IS NOT NULL" != "NOT NULL"  (Sean Chittenden <sean@chittenden.org>)
Responses Re: "IS NOT NULL" != "NOT NULL"
List pgsql-general
Sean Chittenden <sean@chittenden.org> writes:
> test_pgsql=# SELECT COUNT(*) FROM test WHERE col2 NOTNULL;
>  count
> -------
>      3
> (1 row)

> test_pgsql=# SELECT COUNT(*) FROM test WHERE col2 != NULL;
>  count
> -------
>      0
> (1 row)

These are not the same thing.  See any of the past discussions about
why "null = null" and "null != null" and so forth do not do what a
novice might expect.

            regards, tom lane

pgsql-general by date:

Previous
From: Sean Chittenden
Date:
Subject: Re: "IS NOT NULL" != "NOT NULL"
Next
From: "Tim Barnard"
Date:
Subject: Clarification question