SELECT team, w, l, sum( w / ( w + l ) ) AS pct, MAX( w - l ) - ( w - l ) / 2 AS gb
FROM standings
GROUP BY team
ORDER BY w DESC
I am wondering why its calculating wrong.
max(4-0) - (1-3)/2
MAX( w - l ) - ( w - l ) / 2
Mathematically the above should equal 3, its outputting -1
(4-0) - (1-3)/2 = 3
Is it the equation, or the query?
thanks,
FROM standings
GROUP BY team
ORDER BY w DESC
I am wondering why its calculating wrong.
max(4-0) - (1-3)/2
MAX( w - l ) - ( w - l ) / 2
Mathematically the above should equal 3, its outputting -1
(4-0) - (1-3)/2 = 3
Is it the equation, or the query?
thanks,