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 'AND zona.flg_inv=1 immobile.id_citta=3 AND flg_off_cat=0 GROUP BY immobile.id_c' at line 1