From: | hubert depesz lubaczewski <depesz(at)depesz(dot)com> |
---|---|
To: | Rishi Ranjan <rishiranjan706(at)gmail(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: pgsql-function |
Date: | 2015-04-14 11:27:03 |
Message-ID: | 20150414112703.GB2224@depesz.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | 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/
From | Date | Subject | |
---|---|---|---|
Next Message | Rishi Ranjan | 2015-04-14 17:20:46 | Re: pgsql-function |
Previous Message | Rishi Ranjan | 2015-04-14 10:39:38 | pgsql-function |