Query creation to separe Month and Year and SUM activity HOURS

Hi folks,

I need to make a Grafana query.
The MySQL table database have information about interventions of our workers to help our clients. There is intervention Date, Intervention hours, travel hours, extra hours and other fields.

The result should have a Sum of hour of workerd fields, and separated by month and year.

We have tried with this query without sucess in Grafana:

--SELECT DISTINCT MONTH(DATA_INTERVENCIO) AS "MES", YEAR(DATA_INTERVENCIO) AS "AÑO" FROM ElektraCatConsultes.CONSULTES ORDER BY 1,2;
SELECT
    YEAR(DATA_INTERVENCIO) AS año,
    MONTH(DATA_INTERVENCIO) AS mes
FROM
    ElektraCatConsultes.CONSULTES
GROUP BY
    YEAR(DATA_INTERVENCIO), MONTH(DATA_INTERVENCIO)
ORDER BY
    mes, año;

This query works on PHPMyAdmin, but don’t works in Grafana in table format.

Best Regards

can you run the query through the query inspect button, and see what the actual query looks like to grafana?

Thank you @sowdenraymond, the problem is when we include comments in first lines.
Deletting comments it’s working fine.

Regards