| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера