Re: Comparing times to "now + 45 seconds"

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Comparing times to "now + 45 seconds"
Дата
Msg-id hjh7bv$8eb$1@ger.gmane.org
обсуждение исходный текст
Ответ на Comparing times to "now + 45 seconds"  (Rikard Bosnjakovic <rikard.bosnjakovic@gmail.com>)
Ответы Re: Comparing times to "now + 45 seconds"
Список pgsql-novice
Rikard Bosnjakovic wrote on 24.01.2010 11:08:
> I want to compare these times to the actual (current) time + 45
> seconds. If the current time + 45 seconds is higher than the time in
> the table, I want "true". First, I tried this:
>
> # select times, times>  now()::time AS time_compare from live_stats;
[...]

> Which works, but I don't know how to apply the "45 seconds":
>
> # select times, times>  (now()::time + '45 seconds') AS time_compare
> from live_stats;

You need to add an interval.

This should work:

SELECT times, times > (now()::time + interval '45' second) as time_compare
FROM live_stats;


Regards
Thomas

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

Предыдущее
От: "Jean-Yves F. Barbier"
Дата:
Сообщение: Re: Comparing times to "now + 45 seconds"
Следующее
От: Rikard Bosnjakovic
Дата:
Сообщение: Re: Comparing times to "now + 45 seconds"