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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -