- 参考答案
#1. 查询到最大,最小salary的数据集
#2. 求出不在这个最大最小数据集的薪水的avg
select avg(a.salary) avg_salary
from salaries a
where a.to_date='9999-01-01'
and a.salary not in (select max(b.salary) from salaries b where b.to_date='9999-01-01')
and a.salary not in (select min(b.salary) from salaries b where b.to_date='9999-01-01');