If I want to add up two values in a query, I can use the
If I want to sum up all values returned by a query, I can use
If I want to multiply two values in a query, I can use the
If, however, I want to multiply together all values returned by a query, there does not appear to be a
PRODUCT or the like.
I find myself using
exp(sum(ln(X))), which is ridiculous. It's astonishing that this feature is not present since even more "esoteric" things like covariances and regression coefficients are conveniently available in some dialects.
Why is it that the SQL standard does not have this (I believe) "basic" feature? Surely it must be a conscious design decision. Are there any technical advantages to not having this operation or discouraging users from performing multiplication on large query results?