Re: Date Arithmetic in PL/pgSql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Date Arithmetic in PL/pgSql
Дата
Msg-id 9237.1123535369@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Date Arithmetic in PL/pgSql  (John DeSoi <desoi@pgedit.com>)
Ответы Re: Date Arithmetic in PL/pgSql  ("Lane Van Ingen" <lvaningen@esncc.com>)
SQL Time Issue  (<operationsengineer1@yahoo.com>)
Список pgsql-novice
John DeSoi <desoi@pgedit.com> writes:
> On Aug 8, 2005, at 4:23 PM, Lane Van Ingen wrote:
>> I am trying to do some simple date arithmetic.

> select '2005-08-08 16:15:30'::timestamp - '310 seconds'::interval;

I think the "computed" part is the bit that's missing.  Maybe he wants

select '2005-08-08 16:15:30'::timestamp - (expression) * '1 sec'::interval;

This should work for pretty much any numeric expression.

            regards, tom lane

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

Предыдущее
От: John DeSoi
Дата:
Сообщение: Re: Date Arithmetic in PL/pgSql
Следующее
От: "Jeff Eckermann"
Дата:
Сообщение: Re: Uploading and loading