Fix error in SQL statement