I have a few BIGINT columns I would like to add and then divide producing a percentage. When I do this in SQL, I receive a result of 0. When I do it with a calculator, it comes out to .97 or something. I am certain I am selecting only one record.
This returns 0
select
a / (a + b) as foo
from
bar
This returns 0.000
select
decimal(a / (a + b), 4, 3) as foo
from
bar
Thank you for your assistance.