Re: select an entry with a NULL date field - Mailing list pgsql-sql

From Mark Volpe
Subject Re: select an entry with a NULL date field
Date
Msg-id 39982D57.EA00C0C6@epamail.epa.gov
Whole thread Raw
In response to select an entry with a NULL date field  (Web Manager <web@inter-resa.com>)
List pgsql-sql
The syntax you're looking for is:

SELECT entry_id FROM tbl_date WHERE date_02 IS NULL;

Mark

Web Manager wrote:
> 
> 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


pgsql-sql by date:

Previous
From: " Date:
Subject: Re: select an entry with a NULL date field
Next
From: Henry Lafleur
Date:
Subject: RE: select an entry with a NULL date field