Fix sql syntax problem.