Invalid query : select ttTecmoOrder, ttName, ttCity, sum(gsINTs) as ints, sum(gsINTs)/COUNT(DISTINCT(gsgUID)) as avgints, sum(gsInj)/3 as inj, ttPointsFor as pts, ttPointsFor/COUNT(DISTINCT(gsgUID)) as avgpts , 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 group by tttID order by desc, avgpts desc