SQL Language (MOSC)

MOSC Banner

how can i return a null when summing and deviding columns values when some of the values have nulls

edited Jul 1, 2020 6:50AM in SQL Language (MOSC) 10 commentsAnswered ✓

how can i return a null when summing and dividing column values when some of the values have nulls or zeroes. Basically want to return a null  when I sum up multiple column values  whenever some of the values have a zero or null. Here is my current query that  I am trying to use to accomplish this but its not returning null as expected.

  

    (((CAST (column1 AS NUMBER) - 57.81114) / 24.79211) + ((CAST(column2 AS NUMBER) - 40.7836082505127) / 17.5946375921401) + ((CAST (column3 AS NUMBER) - 49.4958123953099) / 27.9601909416896) ) / 3 Grand_Total,

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center