I have a MySQL query to extract the budgets of the last year (the highest year registered in the table):
select *
from Presupuestos
where year(fecha) = max(year(fecha))
the date column is of type DATE.
When executing the query, it shows me:
SQL Error (1111): Invalid use of group function
Any solution? Thanks