Re: Retrieving NULL records - Mailing list pgsql-novice

From Tom Lane
Subject Re: Retrieving NULL records
Date
Msg-id 18569.1059457275@sss.pgh.pa.us
Whole thread Raw
In response to Retrieving NULL records  ("psql novice" <psql_novice@operamail.com>)
List pgsql-novice
"psql novice" <psql_novice@operamail.com> writes:
> stock=> select * from stock where qty = NULL;

The correct incantation is

 select * from stock where qty IS NULL;

Ordinary comparisons involving NULL always fail (or more accurately,
return NULL).  You have to use the special "is null" operator instead.

            regards, tom lane

pgsql-novice by date:

Previous
From: "psql novice"
Date:
Subject: Retrieving NULL records
Next
From:
Date:
Subject: Re: Retrieving NULL records