Create custom aggregate function and custom sfunc

Поиск
Список
Период
Сортировка
От Jasmin Dizdarevic
Тема Create custom aggregate function and custom sfunc
Дата
Msg-id a0eee4d40907020748p7cb9bad7mad8817e60e9ea89@mail.gmail.com
обсуждение исходный текст
Ответы Re: Create custom aggregate function and custom sfunc  (justin <justin@emproshunts.com>)
Re: Create custom aggregate function and custom sfunc  (Greg Stark <gsstark@mit.edu>)
Список pgsql-sql
 hi,
 
i have to create a aggregate function which evaluates a maximum text value but with some conditions i have to take care of.
is there a way to access a value set of each group?
e.g.:
 
customer ; seg
111 ; L1
111 ; L2
111 ; L1
222 ; L3
222 ; L3
222 ; L2
 
the result should look like this:
 
111: L1 - because L1 is higher than L2 and ratio of L1 : L2 is 2 : 1
222: L3 - because L3 is higher than L2 and ratio of L3 : L2 is 2 : 1
 
i hope you know what i mean.
 
ty
 
 

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

Предыдущее
От: Tim Haak
Дата:
Сообщение: Re: Partitioned tables not using index for min and max 8.2.7?
Следующее
От: justin
Дата:
Сообщение: Re: Create custom aggregate function and custom sfunc