方法)NOT IN
SELECT AVG(salary) FROM salaries WHERE salary NOT IN( SELECT MAX(salary) FROM salaries WHERE to_date = '9999-01-01') AND salary NOT IN ( SELECT MIN(salary) FROM salaries WHERE to_date = '9999-01-01') AND to_date = '9999-01-01';用NOT IN + 子查询筛选排除掉最大值和最小值