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;

 

posted @ 2012-02-24 17:54  合肥房屋托管  阅读(1360)  评论(0编辑  收藏  举报