Updates query.