sql - Divisor coming as null -


i have find percentage difference between 2 numbers.

i using formula a-b/(a+b/2)

i.e

select round( ( a-b)/(a+b/2)) dual; 

where , b 2 numbers. if , b 0 divisor comes zero. in case can done avoid error ? percentage difference between 2 equal numbers or 0 ?


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -