INF: How to Calculate the Product of a FieldID: Q89656
|
This article describes how to determine the product of the values in a field. This method behaves in the same fashion as if there is a PRODUCT() aggregate function.
To calculate the product for a particular column, you can take the
base 10 log of the values, sum them, and then take the antilog (using
the POWER() function with a base 10) of the summation.
col
---
5
14
2
SELECT POWER(10, SUM(LOG10(<col>)))
FROM <table>
SELECT POWER(10.0, SUM(LOG10(<col>)))
FROM <table>
SELECT POWER($10.0, SUM(LOG10(<col>)))
FROM <table>
Additional query words: Transact-SQL multiplication multiple
Keywords : kbother SSrvServer
Version : 4.2
Platform : OS/2
Issue type :
Last Reviewed: March 13, 1999