首页 > 代码库 > oracle 组函数
oracle 组函数
group by的增强 SQL> select deptno,job,sum(sal) from emp group by deptno,job SQL> + SQL> select deptno,sum(sal) from emp group by deptno SQL> + SQL> select sum(sal) from emp SQL> SQL> === SQL> SQL> select deptno,job,sum(sal) from emp group by rollup(deptno,job); SQL> SQL> 抽象 SQL> group by rollup(a,b) SQL> == SQL> group by a,b SQL> + SQL> group by a SQL> + SQL> group by null SQL> SQL> */ SQL> select deptno,job,sum(sal) from emp group by rollup(deptno,job);
报表
break on deptno skip 2 SQL> / DEPTNO JOB SUM(SAL) ---------- --------- ---------- 10 CLERK 1300 MANAGER 2450 PRESIDENT 5000 8750 20 CLERK 1900 ANALYST 6000 MANAGER 2975 10875 DEPTNO JOB SUM(SAL) ---------- --------- ---------- 30 CLERK 950 MANAGER 2850 SALESMAN 5600 9400 29025
oracle 组函数
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。