Fix SQL syntax for MySQL