Thursday, January 17, 2008

Oracle: How to multiply a column in oracle

do you want to multiply a column in your table one way to do it is by this

SELECT EXP (SUM (LN (ABS (x))))
* DECODE (MOD (COUNT (DECODE (SIGN (x), -1, 1, NULL)), 2), 1, -1, 1) *
nvl(max(decode(x,0,0,null)),1) prod
FROM t

No comments: