group by 字句的擴展+rollup字句+cube字句+grouping()函數

1rollup字句 rollup字句擴展group by字句,爲每一個分組返回一條小計記錄,併爲全部分組返回總計 列如:rollup字句獲取每個部門的工資總計 select d.dname,sum(e.sal) from emp e,dept d where e.deptno=d.deptno group by rollup(d.dname) order by d.dname; 解釋: dname
相關文章
相關標籤/搜索