Re: Temporal Units

Поиск
Список
Период
Сортировка
От Lew
Тема Re: Temporal Units
Дата
Msg-id IJCdnRD0HqfQsaTbnZ2dnUVZ_j-dnZ2d@comcast.com
обсуждение исходный текст
Ответ на Re: Temporal Units  (Rich Shepard <rshepard@appl-ecosys.com>)
Ответы Re: Temporal Units  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general
John D. Burger wrote:
>> There was a brief discussion of this just last week, with a few solutions
>> suggested:
>>
>> http://archives.postgresql.org/pgsql-general/2007-04/msg01098.php

Rich Shepard wrote:
>   That thread asked how to find business days between any two specified
> dates. I would like to create a calendar table that includes business days,
> holidays, Julianized dates, and other interesting tid-bits that are of
> value
> in a business application. Then dates can be looked up in the table to
> learn
> their attributes and the calculations don't need to be done each time.

The best solution I've encountered so far to this type of problem is to have a
table of "days" with columns like isWeekday, isHoliday, julianDay,
otherTidbit, ...

Then you select or join the days within the interval of interest and factor
out weekdays, or holidays, or whatever.

--
Lew

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

Предыдущее
От: Barry Brown
Дата:
Сообщение: Separating function privileges from tables
Следующее
От: jasme
Дата:
Сообщение: WAL