Invalid query : select pID, first, last, gsAttempts, gsComps, gsComps/gsAttempts*100 as compPerc, gsPassYards, gsPassTDs, gsINTs, ((GREATEST(0, LEAST(2.375,((((gsComps / gsAttempts) * 100) - 30) * .05))) + GREATEST(0, LEAST(2.375,(((gsPassYards / gsAttempts) - 3) * .25))) + LEAST(2.375, ((gsPassTDs / gsAttempts) *20)) + GREATEST(0, (2.375 -((gsINTs / gsAttempts) * 25))))*50/3) AS nfl_rating , tID, city, tname from tecmoplayer, game_stats, tecmoteam where gslUID = 1 AND pID = gspUID AND tID = gsTeam AND gsSeason = AND gPlayoff = 1 AND pos = 0 group by pID order by nfl_rating desc