mysql查詢部門,計算每個部門有多少名員工的mysql語句是什么?
selectt1.*,t2.s
fromemp_hiloot1join(selectdeptno,avg(salary)sfromemp_hiloogroupbydeptno)t2
ont1.deptno=t2.deptno
wheret1.salary>t2.s
selectt1.*,t2.s
fromemp_hiloot1join(selectdeptno,avg(salary)sfromemp_hiloogroupbydeptno)t2
ont1.deptno=t2.deptno
wheret1.salary>t2.s