Database ERROR

SQL ERROR [20:27:58]: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 '' at line 12
Invalid SQL [1064]: SELECT K.* FROM kei_customers K LEFT JOIN kei_custcolgroups G ON (K.kid=G.kid) WHERE K.cms_isindex=1 AND K.sperren=0 ORDER BY
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 '' at line 12