Invalid query dude : select ttTecmoOrder, ttName, ttCity , sum(gsTackles)/COUNT(DISTINCT(gsgUID)) as avgtacks, sum(gsDINTs) as ints, sum(gsDINTs)/COUNT(DISTINCT(gsgUID)) as avgints, sum(gsSacks) as sacks, sum(gsSacks)/COUNT(DISTINCT(gsgUID)) as avgsacks , tttID, pNumber, COUNT(DISTINCT(gsgUID)) as gp, pInjured 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 = 2010 AND tttID = gsTeam AND psUID = gsSeason AND gsTeam = tttID AND psUID = ttsUID AND gsWeek <= 20 AND (gsDINTs > 0 OR gsSacks > 0 OR gsDINTTDs > 0 OR gsTackles > 0) group by tttID order by desc, ints desc, sacks desc, avgtacks desc