Error in query: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4

SELECT t1.*, t2.Csoport, (CASE WHEN t1.Megvasarolhato THEN 1 ELSE 0 END) AS Megvasarolhato_Ck FROM galeria t1 LEFT JOIN galeria_csoport t2 ON t2.ID=t1.ID_csoport WHERE t1.ID=