Skip site navigation (1) Skip section navigation (2)

select an entry with a NULL date field

From: Web Manager <web(at)inter-resa(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: select an entry with a NULL date field
Date: 2000-08-14 14:02:55
Message-ID: 3997FC0F.96ACA1A8@inter-resa.com (view raw or flat)
Thread:
Lists: pgsql-sql
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

Responses

pgsql-sql by date

Next:From: Andreas TilleDate: 2000-08-14 16:08:34
Subject: Any SQL-functions examples available
Previous:From: Jesus AneirosDate: 2000-08-12 20:57:56
Subject: Re: Operator Precedence problem?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group