pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: D'Arcy J.M. Cain <darcy@druid.net>
To: John B. Scalia <jscalia@cityblueprinting.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: query using a date field that isn't set
Date: Sun, 7 Nov 2004 20:56:26 -0500
Message-ID: <20041107205626.3db6a856.darcy@druid.net> (raw)
In-Reply-To: <0I6K008ES6EI0H@chimmx04.algx.net>
References: <0I6K008ES6EI0H@chimmx04.algx.net>

On Tue, 02 Nov 2004 10:44:41 -0500
"John B. Scalia" <jscalia@cityblueprinting.com> wrote:
> I've got a SQL problem that's stumping me. I have an employee table
> with a field labeled:
> 
> Emp_terminated            DATE
> 
> Obviously, some employees in this table won't have this field set. I
> want a query to select only employees without this field being set,
> ie., only current employees. I've got the inverse working by using:
> 
> SELECT * FROM employee WHERE ISFINITE(emp_terminated);

From http://www.postgresql.org/docs/faqs/FAQ.html:

4.13) In a query, how do I detect if a field is NULL?

You test the column with IS NULL and IS NOT NULL.

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



view thread (2+ messages)

Message-ID: <20041107205626.3db6a856.darcy@druid.net>
Permalink:  ../20041107205626.3db6a856.darcy@druid.net/
Also on:    postgresql.org/message-id/20041107205626.3db6a856.darcy@druid.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: darcy@druid.net, jscalia@cityblueprinting.com
  Subject: Re: query using a date field that isn't set
  In-Reply-To: <20041107205626.3db6a856.darcy@druid.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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