Re: Odd behavior with NULL value

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Odd behavior with NULL value
Дата
Msg-id 16208.1008909659@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Odd behavior with NULL value  (bsmith@h-e.com (Bob Smith, Hammett & Edison, Inc.))
Список pgsql-admin
bsmith@h-e.com (Bob Smith, Hammett & Edison, Inc.) writes:
> Here is the problem I'm trying to solve, perhaps someone can help.
> For an invoicing system database, I have a table that defines
> employees.  Each has a begin and end date defining the employment
> period.  For current employees, the end date is "open".  How do I
> express that to keep queries as simple as possible?

NULL seems like the most obvious and portable answer, though you might
have to phrase queries carefully to make it work.  Another possibility
is to use timestamp rather than date, so you could use "+infinity" for
the end date of active employees.

            regards, tom lane

В списке pgsql-admin по дате отправления:

Предыдущее
От: bsmith@h-e.com (Bob Smith, Hammett & Edison, Inc.)
Дата:
Сообщение: Re: Odd behavior with NULL value
Следующее
От: Bill Cunningham
Дата:
Сообщение: Re: Odd behavior with NULL value