Change a SQL query.