Re: pgsql-function

From: Rishi Ranjan <rishiranjan706(at)gmail(dot)com>
To: depesz(at)depesz(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: pgsql-function
Date: 2015-04-14 17:20:46
Message-ID: CALiz8WSSMtG8Gp5EE11i6PpFLLMzTqhEL_XnDuDQatKkdv4Qgg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

we are using version 9.4.
2) The result of above calculation i need to use in different calculation .
means output of this calculation will let us to determine the value of
some parameters of other equation like below

y= ((y2-y1)/(x2-x1 ))x+ (y1- (y2-y1)/(x2-x1 ) x1 )

where x1,y1,x2,y2 parameters are defined and whose value need to be picked
based on value of x (being calculated from above scenario provided with
sample data)

so help me to decide in what way we can proceed

3) from above data in firstoccurence column there is up time and down time
of some device and we need to choose higher severity value .

On 14 April 2015 at 04:27, hubert depesz lubaczewski <depesz(at)depesz(dot)com>
wrote:

> 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/
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David G. Johnston 2015-04-14 17:28:13 Re: pgsql-function
Previous Message hubert depesz lubaczewski 2015-04-14 11:27:03 Re: pgsql-function