January 2008
Intermediate to advanced
384 pages
8h 1m
English
If you were a math major, you would write capital sigma (Σ) for summation and capital Pi (Π) for product for the aggregate summation and aggregate product, respectively. The SUM() and SUM () PO OVER () functions are the SQL versions of the sigma. We do not have an aggregate function in SQL, but if we did the syntax for it would look something like:
PRD ([DISTINCT] <expression>) [<window clause>]
You can create such an aggregate from the LN() natural log function and LOG10() base ten logarithm function. But you will need CASE expressions to handle some special situations.
If there is a zero anywhere in the column, the answer is zero. Oh, the logarithm is not defined for zero.
If the values are all positive, you ...
Read now
Unlock full access