Re: interval

Поиск
Список
Период
Сортировка
От Yuri A. Kabaenkov
Тема Re: interval
Дата
Msg-id 1740527435.20011203200953@artofit.com
обсуждение исходный текст
Ответ на Re: interval  (Thomas Lockhart <lockhart@fourpalms.org>)
Список pgsql-general
Hello Thomas,

Monday, December 03, 2001, 8:01:45 PM, you wrote:

>>       How can i get time interval only in minutes or in seconds ?
>>       For example i have '1 month 15 days' and i need these time in
>>       minutes.

TL> lockhart=# select extract(epoch from interval '1 month 15 days') / 60;
TL>  ?column?
TL> ----------
TL>     64800
TL> (1 row)

Oh...thanks one more question.

I create these function:

CREATE FUNCTION sum_revenue() RETURNS real AS '

DECLARE
call RECORD;


BEGIN
        tmpsum := 0;
                FOR call IN SELECT
                country,(date_part('epoch), starttime - endtime)::float AS seconds ,type from calls where sub_acc = 4
LOOP
                        RETURN call.minutes;
                END LOOP;
 end;
' LANGUAGE 'plpgsql';

And in call.minutes i've got '0';

Why ? How can i retrive call.minutes ?

these RETURN only for debug.



TL>                       - Thomas



------------
With respect,
Yuri A. Kabaenkov
hellman@artofit.com


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

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: interval
Следующее
От: bombadil@wanadoo.es
Дата:
Сообщение: Re: Problem (bug?) with like