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

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: query using a date field that isn't set
Дата
Msg-id 20041107205626.3db6a856.darcy@druid.net
обсуждение исходный текст
Ответ на query using a date field that isn't set  ("John B. Scalia" <jscalia@cityblueprinting.com>)
Список 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 по дате отправления:

Предыдущее
От:
Дата:
Сообщение: oracle v$session equivalent in postgresql
Следующее
От: "D'Arcy J.M. Cain"
Дата:
Сообщение: Re: third edition of SQL FOR SMARTIES