Invalid query : select CASE WHEN (pos = 2 AND (pMS+pREC>=125)) THEN 'A' WHEN (pos=2 AND (pMS+pREC>=101 AND pMS+pREC<=124)) THEN 'B' WHEN (pos=2 AND (pMS+pREC<101)) THEN 'C' ELSE 'n/a' END AS Grade, pos, pUID, first, last, ttAbrev, ttTecmoOrder, sum(gsReceptions) as Receptions, sum(gsReceptionYards) as ReceptionYards, sum(gsReceptionYards)/sum(gsReceptions) as AvgRec, sum(gsReceptionTDs) as ReceptionTDs , tttID, pNumber 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 = 2024 AND tttID = gsTeam AND psUID = gsSeason AND gsTeam = tttID AND psUID = ttsUID AND gsWeek <= 16 AND (pos = 1 OR pos = 2) AND gsReceptions > 0 group by gspUID, gsTeam order by asc, ReceptionYards desc, AvgRec desc, ReceptionTDs desc