Re: query using a date field that isn't set

On Tue, 02 Nov 2004 10:44:41 -0500
"John B. Scalia" <jscalia [at] 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 [at] 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.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
darcy [ Mo, 08 November 2004 02:56 ] [ ID #471191 ]
Datenbanken » comp.databases.postgresql.sql » Re: query using a date field that isn't set

Vorheriges Thema: third edition of SQL FOR SMARTIES
Nächstes Thema: sql problem