Fix SQL syntax issue