select deptno,avg(sal)
from emp group by deptno
having avg(sal) =
(select max(avg(sal)) from emp group by deptno);
from emp group by deptno
having avg(sal) =
(select max(avg(sal)) from emp group by deptno);
2018-02-19
最新回答 / 180416
select d.deptno,d.dname,count(e.empno) from emp e right join dept d on e.deptno=d.deptno group by d.deptno,d.dname;等同于右外连接;两种语句区别也不大,但是外连接的符号位置不常用估计会记错。
2018-02-17