How to multiply values of the columns based on the value in one column.
Example
Col1 Col2 Col3 Col4
10 10 10 casea (multiply col1 * col2)
20 20 20 caseb (multiply col1 * col3)
30 30 30 casec (multiply col2 * col3)
A query like:
select col1, col2, col3, col4, total
would return
10,10,10,casea,100
20,20,20,caseb,400
30,30,30,casec,900
Of course performance is an important issue as always.
Thanks for participating.
1 Answer