RE: select an entry with a NULL date field

From: Jesus Aneiros <aneiros(at)jagua(dot)cfg(dot)sld(dot)cu>
To: Henry Lafleur <HLafleur(at)phoenixforge(dot)com>
Cc: Web Manager <web(at)inter-resa(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: RE: select an entry with a NULL date field
Date: 2000-08-14 21:26:12
Message-ID: Pine.LNX.4.10.10008141724390.10420-100000@jagua.cfg.sld.cu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I think undefined is the exact result for that comparison, therefore the
returned error. False value will not be an error.

--
Jesus Aneiros Sosa
mailto:aneiros(at)jagua(dot)cfg(dot)sld(dot)cu
http://jagua.cfg.sld.cu/~aneiros

On Mon, 14 Aug 2000, Henry Lafleur wrote:

> Comparing anything = NULL (if it would work) would always false, at least
> that's how other servers treat it. You have to use IS NULL.
>
> select entry_id from tbl_date where date_02 IS NULL;
>
> Henry
>
>
> -----Original Message-----
> From: Web Manager [mailto:web(at)inter-resa(dot)com]
> Sent: Monday, August 14, 2000 9:03 AM
> To: pgsql-sql(at)postgresql(dot)org
> Subject: [SQL] select an entry with a NULL date field
>
>
> Hello,
>
>
> I have a problem with PostgreSQL when I try to select or delete an entry
> with an empty date. That's a typical entry
>
> Table tbl_date
> -----------------------------
> entry_id 154
> date_01 2000-01-15
> date_02 this date is NULL
> name my_test
> -----------------------------
>
> I want to select every entry containing date_02 as NULL
> I tried :
> >select entry_id from tbl_date where date_02=NULL;
> ERROR: parser: parse error at or near "null"
> >select entry_id from tbl_date where date_02='';
> Not work, that's a wrong date format
> >select entry_id from tbl_date where date_02="";
> Not work, "" considered as an attribute
>
> Thank you for your time!
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Marc Andre Paquin
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Thomas Swan 2000-08-15 06:18:14 Functions with Null Arguments?
Previous Message Madel, Kurt 2000-08-14 20:40:09 Creating A Rule to Increment a class size when a student adds tha t class to their schedule