Invalid query : select gsTeam, pUID, first, last, face, race, sum(gsAttempts) as Attempts, sum(gsComps) as Comps, ((GREATEST(0, LEAST(2.375,((((SUM(gsComps) / SUM(gsAttempts)) * 100) - 30) * .05))) + GREATEST(0, LEAST(2.375,(((SUM(gsPassYards) / SUM(gsAttempts)) - 3) * .25))) + LEAST(2.375, ((SUM(gsPassTDs) / SUM(gsAttempts)) *20)) + GREATEST(0, (2.375 -((SUM(gsINTs) / SUM(gsAttempts)) * 25))))*50/3) AS nfl_rating, ptttID, pNumber, pInjured, dod, gsUser from player_atts, tecmoplayer, game_stats where (pPC>=63 OR (pPC=56 AND pPS>=69) OR (pPC=56 AND pMS>=25)) AND pUID = pID AND pUID = gspUID AND plUID = 0 AND gslUID = plUID AND gsSeason = AND ptttID = gsTeam AND psUID = gsSeason AND gsWeek <= 14 AND pos = 0 group by gspUID, gsTeam having sum(gsAttempts) > 5* order by nfl_rating desc limit 10