Re: query using a date field that isn't set - Mailing list pgsql-sql

From D'Arcy J.M. Cain
Subject Re: query using a date field that isn't set
Date
Msg-id 20041107205626.3db6a856.darcy@druid.net
Whole thread Raw
In response to query using a date field that isn't set  ("John B. Scalia" <jscalia@cityblueprinting.com>)
List pgsql-sql
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.


pgsql-sql by date:

Previous
From:
Date:
Subject: oracle v$session equivalent in postgresql
Next
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: third edition of SQL FOR SMARTIES