Re: pgsql-function

Поиск
Список
Период
Сортировка
От Rishi Ranjan
Тема Re: pgsql-function
Дата
Msg-id CALiz8WSSMtG8Gp5EE11i6PpFLLMzTqhEL_XnDuDQatKkdv4Qgg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql-function  (hubert depesz lubaczewski <depesz@depesz.com>)
Ответы Re: pgsql-function
Список 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@depesz.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/

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

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: pgsql-function
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: pgsql-function