用mysql语句查询每个部门中薪资高于该部门平均薪资的员工信息
SELECT e.* FROM employee e WHERE e.salary > (SELECT AVG(salary) FROM employee WHERE department_id = e.department_id) ORDER BY e.department_id, e.salary DESC;
原文地址: http://www.cveoy.top/t/topic/ejJR 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
SELECT e.* FROM employee e WHERE e.salary > (SELECT AVG(salary) FROM employee WHERE department_id = e.department_id) ORDER BY e.department_id, e.salary DESC;
原文地址: http://www.cveoy.top/t/topic/ejJR 著作权归作者所有。请勿转载和采集!