Skip to content
Advertisement

How to do division in SQL query between two column

enter image description here In the above image I have 4 column and I am trying to get the average value of criticality and Priority by dividing it by the totalNumber. But for some reason my query is not working and I also trying to just get one decimal place after the division.

My sql query:

Advertisement

Answer

Try to use cast(round(criticality/totalNumber,1) as numeric(36,1)) for one decimal place after division.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement