oracle之sql总结2之groupby having ,where in 别名排序
1、select avg(sal) , max(sal) ,deptno from emp group by deptno;
2、 select avg(sal) , max(sal) ,deptno,job from emp group by deptno,job;
3、 select avg(sal) ,deptno from emp group by deptno having avg(sal)<2000;