Errore nel comando sql (SELECT c_dett_copie.id,idutente,cognome, nome, IF(ISNULL(c_dett_copie.annoscol),'2024-2025',c_dett_copie.annoscol) as ann_scol, date_format(data_pronto,"%d-%m-%Y") as data_pronto, data_richiesta as dt_rich, date_format(data_richiesta,"%d-%m-%Y %H:%i") as data_richiesta, scopo, fronte_retro, formato_foglio, ncopie, flag_pronto, data_pronto, flag_pronto, c_dett_copie.email, refid_docente, filename, filesize, flag_inviata, npagine, istituto, flag_amano FROM `utenti` left join c_dett_copie on c_dett_copie.refid_docente=idutente WHERE idcategoria=2 and idutente>1 and attivo=1 and idutente= order by cognome ASC, nome ASC, annoscol DESC, flag_pronto, dt_rich DESC): (1064) 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 'order by cognome ASC, nome ASC, annoscol DESC, flag_pronto, dt_rich DESC' at line 1