You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY id_agencia' at line 1

SELECT nombre_deporte FROM deportes_agencias INNER JOIN deportes USING (id_deporte) WHERE id_agencia= GROUP BY id_agencia