April 30, 2019 at 12:00 am
Comments posted to this topic are about the item Ignoring Divide by Zero
May 3, 2019 at 6:03 am
This has proven to be very handy
Nice question, thanks Steve
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
May 3, 2019 at 10:30 am
got it wrong but learnt something new,
cheers Steve
---------------------------------------------------------------------------------------
The more you know, the more you know that you dont know
May 3, 2019 at 11:34 pm
I guess the real key here is that if you're dividing by zero, there's something wrong with your data, your code, or both. I've never ignored divide by zero errors and probably never will. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
June 13, 2019 at 12:39 am
One approach to avoid dividing by 0 is the NULLIF trick:
SELECT Numerator/NULLIF(Divisor, 0)
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply