lijun


Aggregation SUM adds the numbers together. Is there a similar aggregation function that returns the product of all the numbers


Thanks



Re: aggregation question

Kent Waldrop Ap07


No, there is no built-in PRODUCT aggregate. One thing you could try is taking the exponent of the sum of the logs of the individual rows; however, this will tend to cause arithmetic execution errors if any of the individual rows have zero for a value.

Here is a similar discussion:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=355075&SiteID=1






Re: aggregation question

Arnie Rowland

Do you mean 'product' as in factorial







Re: aggregation question

Umachandar Jayachandran - MS

Check out the link below for a solution that uses the built-in aggregates to compute product:
You can also write a SQLCLR aggregate in SQL Server 2005 to do the same.