Invalid query : select pUID, first, last, ttAbrev, ttTecmoOrder, sum(gsXPAttempts) as XPAttempts, sum(gsXPMade) as XPMade, sum(gsXPMade)/sum(gsXPAttempts)*100 as XPperc, sum(gsFGAttempts) as FGAttempts, sum(gsFGMade) as FGMade, sum(gsFGMade)/sum(gsFGAttempts)*100 as FGperc, sum(gsFGMade)*3+sum(gsXPMade) as Points , 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 = 2 AND gslUID = plUID AND ttlUID = gslUID AND gsSeason = 1994 AND tttID = gsTeam AND psUID = gsSeason AND gsTeam = tttID AND psUID = ttsUID AND gsWeek <= 16 AND (pos = 8) group by gspUID, gsTeam having (sum(gsFGMade) > 0 OR sum(gsXPMade) > 0) order by desc, Points desc, FGMade desc