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

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

am 08.11.2004 02:56:26 von darcy

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