Invalid query : select pUID, first, last, ttAbrev, ttTecmoOrder, sum(gsPunts) as Punts, sum(gsPuntYards) as PuntYds, sum(gsPuntYards)/sum(gsPunts) as PuntAvg , tttID, pNumber, COUNT(DISTINCT(gsgUID)) as gp, pInjured, dod from player_atts, tecmoplayer, standings, game_stats where pUID = pID AND pttUID = ttTecmoOrder AND pUID = gspUID AND plUID = 1 AND gslUID = plUID AND ttlUID = gslUID AND gsSeason = 2008 AND tttID = gsTeam AND psUID = gsSeason AND ptttID = tttID AND psUID = ttsUID AND gsWeek <= 16 AND gPlayoff != 9 AND (pos = 9) group by gspUID, gsTeam having (sum(gsPunts) > 0) order by desc, PuntAvg desc