Can anyone say why this select returns 3.0 instead of 3.5:
SELECT coalesce(1.0*(7/2),0) as foo This one returns 3:
SELECT coalesce(7/2,0) as foo I'm just trying to divide a SUM by COUNT to find an average. I need it 0 if null and 1 rounded by 1 decimal in case I have results.
coalesce(7/2,0.0)and see if that changes anything. sneaky suspicion it might be imposing int output since 0 is an int.