在学课程: 零基础掌握MySQL数据库 http://www.atstudy.com/course/750 作者: 学掌门网校 时间: 2018-7-19 15:00
select * from dept,(select * from emp,(select deptid v_deptid,avg(salary) v_salary from emp group by v_deptid) avg_salary where emp.deptid=avg_salary.v_deptid and emp.salary>avg_salary.v_salary ) e where dept.id=e.v_deptid