adspace


How to divide by zero and nulls in sybase?

Answer Posted / Mona Chauhan

In Sybase, dividing by zero or null results in an error. To handle this, you can use the ISNULL function to replace null values with a default value, and COALESCE to replace all null values with a single default value. For example, to divide two columns where one may contain nulls, you could do: SELECT ISNULL(col1, 0) / ISNULL(col2, 1) as result.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category