updated where in sql.query