sql - Addition and Division -


i needed doing division calculations 1 decimal. trying sum , divide result. y , x integers.

select a.yearmonth,        (convert(decimal(9,1),y_service)+(convert(decimal(9,1),x_service)/2)) average_of_period table_ib   inner join table_ub b on a.yearmonth=b.yearmonth  

this result get:

yearmonth|  average_of_period            2015-03    276318.500000 

the correct answer :185532,5

my y , x values differ 4 digits 6 digits

looks operation (y) + (x / 2)?

should ( y + x ) / 2?


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -