I need to get the sum of each column of my table. So i used select sum(col1),col2 etc.
If the sum is null, i need to get 0, else the value of the sum. So I used "select case when sum(col1) is null then 0 else sum(col1) end as sum_col1".
I have around 40 such columns in my table. Do i need to write " case when sum(col n) then..." 40 times in my query?
Im working on oracle 9 g. Thanks