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, dyear 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 = 1974 AND tttID = gsTeam AND psUID = gsSeason AND gsTeam = tttID AND psUID = ttsUID AND gsWeek <= 14 AND gPlayoff != 9 AND (pos = 9) group by gspUID, gsTeam having (sum(gsPunts) > 0) order by desc, PuntAvg desc