Modify SQL statement