标签: mysql
MYSQL查询获取所有员工人数均超过10的部门名称。
应该优化查询并且应该更快地执行。
答案 0 :(得分:0)
SELECT dept.name, COUNT(employee.id) as empcount from dept INNER JOIN employee ON dept.id = employee.deptId GROUP BY dept.id HAVING empcount > 10;