Per la precisione ritorna questo errore
Mysql said :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 '[preferito],0)) AS cp FROM B) AS qq3 INNER JOIN (SELECT B.id AS q2id, (Max(nz([' at line 2