Trying to get a percentage (ROUND) off of two SUM columns but everything I try does not work. Is this even possible?
The query I am trying:
SELECT players.id, players.fname, players.lname, teams.name,
player_stats.team_id, divisions.name,
ROUND( ( 1.00 - ( SUM( player_stats.goalsa ) / SUM( player_stats.shotsa ) ) ) , 3 )
AS total_svp
Trying to get SUM of both goalsa and shotsa, divide goalsa by shotsa, subtract that from 1.00, and ROUND that to 2 decimals.
I can do it in PHP no problem, but am hoping to save some time by doing the calculation in the query.
Thanks in advance.