Re: [SQL] Create custom aggregate function and custom sfunc

2009-07-03 Thread Jasmin Dizdarevic
Hi, thank you everybody for your help. The classy solution posted by nha works great! Regards Jasmin 2009/7/3 nha > Hello, > > Le 2/07/09 23:21, Greg Stark a écrit : > > On Thu, Jul 2, 2009 at 3:48 PM, Jasmin >> Dizdarevic wrote: >> >>> customer ; seg >>> 111 ; L1 >>> 111 ; L2 >>> 111 ; L1 >>

Re: [SQL] Create custom aggregate function and custom sfunc

2009-07-02 Thread nha
Hello, Le 2/07/09 23:21, Greg Stark a écrit : On Thu, Jul 2, 2009 at 3:48 PM, Jasmin Dizdarevic wrote: 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

Re: [SQL] Create custom aggregate function and custom sfunc

2009-07-02 Thread Greg Stark
On Thu, Jul 2, 2009 at 3:48 PM, Jasmin Dizdarevic wrote: > 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 rat

Re: [SQL] Create custom aggregate function and custom sfunc

2009-07-02 Thread justin
Jasmin Dizdarevic wrote: 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 res

[SQL] Create custom aggregate function and custom sfunc

2009-07-02 Thread Jasmin Dizdarevic
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: