| От | Tom Lane |
|---|---|
| Тема | Re: Date comparison question |
| Дата | |
| Msg-id | 227.1053452202@sss.pgh.pa.us обсуждение |
| Ответ на | Date comparison question ("Jan Bodey" <jan_bodey@hotmail.com>) |
| Список | pgsql-sql |
"Jan Bodey" <jan_bodey@hotmail.com> writes:
> SELECT * FROM utable
> WHERE now() - utimestamp > interval '10 hours';
> The problem I am having is that the interval is not fixed, and I would like
> to be able to store it as a value in a database table. The unit of the
> interval can, however, be fixed, and will almost certainly be fixed to
> hours.
Do you not want to store the values as type interval? That would seem
like the most straightforward answer. If you really want to store them
as plain numbers, there's a float-times-interval operator, so you could
do something like... > table.float8col * interval '1 hour';
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера