Is it possible to calculate the PRODUCT of field values as they are combined using a GROUP BY clause? For example:
MyID MyValue
1 2
1 3
1 3
2 2
2 3
2 1
SELECT MyID, PRODUCT(MyValue) AS MyValue2
FROM MyTable
GROUP BY MyID;
To give
MyID MyValue2
1 18
2 6
So far I can only do it by taking the SUM of the logarithms i.e. LN(MyValue), then exponentiating these back out. I'd much rather do it in one step i.e. the select statement rather than add a couple of new steps of additional calculations.
Any thoughts gratefully received!
MyID MyValue
1 2
1 3
1 3
2 2
2 3
2 1
SELECT MyID, PRODUCT(MyValue) AS MyValue2
FROM MyTable
GROUP BY MyID;
To give
MyID MyValue2
1 18
2 6
So far I can only do it by taking the SUM of the logarithms i.e. LN(MyValue), then exponentiating these back out. I'd much rather do it in one step i.e. the select statement rather than add a couple of new steps of additional calculations.
Any thoughts gratefully received!