1 查询底薪超过公司平均底薪的员工信息? select e.empno,e.ename,e.salfrom t_emp as e join (select avg(sal) as avg from t_emp) t on e.sal > t.avg 2 统计人数 格式化时间 select count(*) as count, max(a.sal),min(a.sal), avg(a.sal) , floor(avg(DATEDIFF(NOW(),a.hiredate)/365)) from t_…