Given a fictional table such as : (ID INTEGER, VALUE DEC(16,10) )
that contains multiple IDs, each with a varying number of up to say 10 value records per ID.
I need to do some probability math that requires multiplying each of the VALUE records by the next, grouped by ID.
So if ID = 5 and contains 3 records being :
I need to be able to calculate (0.2494747899*0.281512605*0.3159138655) returning a result of : 5,0.022186724
I can kind of figure how to do so but only for individual IDs and having to execute a recursion UDF, that has to be executed for each ID.
Is there a way using say a built in scalar function of sorts to do so over the entire table in one single SQL statement ?
WOW ! .. heh I thought there might have been something that would be able to do what I had hoped, but had no idea what it was and would never have come up with such an elegant and apparently straight forward solution. I really must return to school obviously I must have missed this lesson .. heh