Re: Simple Question

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Simple Question
Дата
Msg-id 20050111221545.GA9759@winnie.fuhr.org
обсуждение исходный текст
Ответ на Simple Question  (Terry Lee Tucker <terry@esc1.com>)
Ответы Re: Simple Question  (Terry Lee Tucker <terry@esc1.com>)
Список pgsql-sql
On Tue, Jan 11, 2005 at 04:42:21PM -0500, Terry Lee Tucker wrote:

> Subject: [SQL] Simple Question

Please use a more descriptive subject -- think about how somebody
looking at a list of 200 messages, all with subjects like "Simple
Question" or "PostgreSQL Question," would decide to look at yours.

> drv_time = 478 / 45.0;
> 
> The value of this is: 10.6222222222222222
> 
> Is there a way of converting this value to an interval. It seems that INTERVAL 
> only works with a quoted literal value.

You can do arithmetic on intervals:

SELECT 478 / 45.0 * interval'1 hour';

For more information, see "Date/Time Functions and Operators" in
the documentation.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Предыдущее
От: Terry Lee Tucker
Дата:
Сообщение: Re: Simple Question
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Simple Question