题解 | #平均工资#
平均工资
https://www.nowcoder.com/practice/95078e5e1fba4438b85d9f11240bc591
select avg(salary) as avg_salary from salaries s inner join ( select max(salary) max, min(salary) min from salaries where to_date = '9999-01-01' ) a where s.salary != max and s.salary!=min and to_date = '9999-01-01'
此题逻辑表达有问题,其他员工的含义不明确,是否是排除 to_date = '9999-01-01' 的最大最小两条数据之后的表中的员工,还是指在to_date = '9999-01-01' 的1组员工中,仅排除前两条,