Re: Retrieving NULL records

From: <email(at)juergen-cappel(dot)de>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Retrieving NULL records
Date: 2003-07-29 06:40:03
Message-ID: 6312635$10594607333f26167d23d2a4.83384765@config11.schlund.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Shouldn't = NULL be considered a syntax error ?

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> schrieb am 29.07.2003, 07:41:15:
> "psql novice" 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Girish Bajaj 2003-07-29 07:53:39 dynamic sql statements and OUT variables
Previous Message Tom Lane 2003-07-29 05:41:15 Re: Retrieving NULL records