Re: pgsql-function

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: pgsql-function
Дата
Msg-id 20150414112703.GB2224@depesz.com
обсуждение исходный текст
Ответ на pgsql-function  (Rishi Ranjan <rishiranjan706@gmail.com>)
Ответы Re: pgsql-function  (Rishi Ranjan <rishiranjan706@gmail.com>)
Список pgsql-sql
On Tue, Apr 14, 2015 at 03:39:38AM -0700, Rishi Ranjan wrote:
> i have data like below and where ap_key is same for two different
> first_occurence column . here i need to write a function which can
> calculate the difference of two timestamp values for a Ap_Key and then with
> difference it should multiply the severity

1. Why does it have to be a function? Can't it simply be a query?
2. Which pg version do you use?
3. Which severity to use? from the earlier FIRSTOCCURRENCE, or later, or  simply higher/lower SEVERITY?

Basically what you're looking for is most likely some group by with
min/max.

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                  http://depesz.com/
 



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

Предыдущее
От: Rishi Ranjan
Дата:
Сообщение: pgsql-function
Следующее
От: Rishi Ranjan
Дата:
Сообщение: Re: pgsql-function