I am writing a query in my DB.
First I take two values from a table and divide them by each other. Based on the sum a certain value will be added to another column depending on the value range this new value falls between. Here's where it gets tricky for me. If both of the original 2 numbers are 0, or the first of the two numbers are 0, then the answer is infinite. I need to have a solid number 0 or greater to be able to assign a value to it. So lets say num1 is 0 and num2 is 10 or 0.
10/0=infinite or
0/0=infinite
How do I do this calculation so I dont get an infinite number and that should resolve the next step for me as well.
In addition, what if I am working on a null value instead of a 0
First I take two values from a table and divide them by each other. Based on the sum a certain value will be added to another column depending on the value range this new value falls between. Here's where it gets tricky for me. If both of the original 2 numbers are 0, or the first of the two numbers are 0, then the answer is infinite. I need to have a solid number 0 or greater to be able to assign a value to it. So lets say num1 is 0 and num2 is 10 or 0.
10/0=infinite or
0/0=infinite
How do I do this calculation so I dont get an infinite number and that should resolve the next step for me as well.
In addition, what if I am working on a null value instead of a 0