pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedselect an entry with a NULL date field
7+ messages / 6 participants
[nested] [flat]
* select an entry with a NULL date field
@ 2000-08-14 14:02 Web Manager <web@inter-resa.com>
2000-08-14 17:02 ` Re: select an entry with a NULL date field Kate Collins <klcollins@wsicorp.com>
2000-08-14 17:33 ` Re: select an entry with a NULL date field Mark Volpe <volpe.mark@epamail.epa.gov>
2000-08-14 18:06 ` Re: select an entry with a NULL date field <Miguel Sofer <mig@utdt.edu>
2000-08-14 19:24 ` Re: select an entry with a NULL date field Jesus Aneiros <aneiros@jagua.cfg.sld.cu>
0 siblings, 4 replies; 7+ messages in thread
From: Web Manager @ 2000-08-14 14:02 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: select an entry with a NULL date field
2000-08-14 14:02 select an entry with a NULL date field Web Manager <web@inter-resa.com>
@ 2000-08-14 17:02 ` Kate Collins <klcollins@wsicorp.com>
3 siblings, 0 replies; 7+ messages in thread
From: Kate Collins @ 2000-08-14 17:02 UTC (permalink / raw)
To: Web Manager <web@inter-resa.com>; +Cc: pgsql-sql
Try:
select entry_id from tbl_date where date02 is null;
Kate
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
--
=================================================
Katherine (Kate) L. Collins
Senior Software Engineer/Meteorologist
Weather Services International (WSI Corporation)
4 Federal Street
Billerica, MA 01821
EMAIL: klcollins@wsicorp.com
PHONE: (978) 670-5110
FAX: (978) 670-5100
http://www.intellicast.com
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: select an entry with a NULL date field
2000-08-14 14:02 select an entry with a NULL date field Web Manager <web@inter-resa.com>
@ 2000-08-14 17:33 ` Mark Volpe <volpe.mark@epamail.epa.gov>
3 siblings, 0 replies; 7+ messages in thread
From: Mark Volpe @ 2000-08-14 17:33 UTC (permalink / raw)
To: Web Manager <web@inter-resa.com>; +Cc: 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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: select an entry with a NULL date field
2000-08-14 14:02 select an entry with a NULL date field Web Manager <web@inter-resa.com>
@ 2000-08-14 18:06 ` <Miguel Sofer <mig@utdt.edu>
3 siblings, 0 replies; 7+ messages in thread
From: " @ 2000-08-14 18:06 UTC (permalink / raw)
To: web@inter-resa.com; +Cc: pgsql-sql
Try
select entry_id from tbl_date where date_02 is NULL;
miguel sofer
>
>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
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: select an entry with a NULL date field
2000-08-14 14:02 select an entry with a NULL date field Web Manager <web@inter-resa.com>
@ 2000-08-14 19:24 ` Jesus Aneiros <aneiros@jagua.cfg.sld.cu>
3 siblings, 0 replies; 7+ messages in thread
From: Jesus Aneiros @ 2000-08-14 19:24 UTC (permalink / raw)
To: Web Manager <web@inter-resa.com>; +Cc: pgsql-sql
Use
select entry_id from tbl_date where date_02 is null;
NULL = NULL is undefined according to SQL standards.
--
Jesus Aneiros Sosa
mailto:aneiros@jagua.cfg.sld.cu
http://jagua.cfg.sld.cu/~aneiros
On Mon, 14 Aug 2000, Web Manager wrote:
> 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
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* RE: select an entry with a NULL date field
@ 2000-08-14 18:09 Henry Lafleur <HLafleur@phoenixforge.com>
2000-08-14 21:26 ` RE: select an entry with a NULL date field Jesus Aneiros <aneiros@jagua.cfg.sld.cu>
0 siblings, 1 reply; 7+ messages in thread
From: Henry Lafleur @ 2000-08-14 18:09 UTC (permalink / raw)
To: Web Manager <web@inter-resa.com>; pgsql-sql
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@inter-resa.com]
Sent: Monday, August 14, 2000 9:03 AM
To: pgsql-sql@postgresql.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
^ permalink raw reply [nested|flat] 7+ messages in thread
* RE: select an entry with a NULL date field
2000-08-14 18:09 RE: select an entry with a NULL date field Henry Lafleur <HLafleur@phoenixforge.com>
@ 2000-08-14 21:26 ` Jesus Aneiros <aneiros@jagua.cfg.sld.cu>
0 siblings, 0 replies; 7+ messages in thread
From: Jesus Aneiros @ 2000-08-14 21:26 UTC (permalink / raw)
To: Henry Lafleur <HLafleur@phoenixforge.com>; +Cc: Web Manager <web@inter-resa.com>; 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@jagua.cfg.sld.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@inter-resa.com]
> Sent: Monday, August 14, 2000 9:03 AM
> To: pgsql-sql@postgresql.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
>
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2000-08-14 21:26 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-08-14 14:02 select an entry with a NULL date field Web Manager <web@inter-resa.com>
2000-08-14 17:02 ` Kate Collins <klcollins@wsicorp.com>
2000-08-14 17:33 ` Mark Volpe <volpe.mark@epamail.epa.gov>
2000-08-14 18:06 ` <Miguel Sofer <mig@utdt.edu>
2000-08-14 19:24 ` Jesus Aneiros <aneiros@jagua.cfg.sld.cu>
2000-08-14 18:09 RE: select an entry with a NULL date field Henry Lafleur <HLafleur@phoenixforge.com>
2000-08-14 21:26 ` Jesus Aneiros <aneiros@jagua.cfg.sld.cu>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox