ITeye博客

cube与rollup的异同

icyheart · 2009-07-06 11:10 · Oracle · 数据库 · Markdown

cube与rollup的异同

 

(1)、它们都有统计的作用

(2)、cube生成的结果集显示了所选列中值的所有组合的聚合

(3)、rollup生成的结果集显示了所选列中值的某一层次结构的聚合(只返回group by中第一个分组条件指定的列的统计行)

(4)cute的执行效率要低于rollup如图:cute为66%,rollup为34%

 

 

 

eg:

select sno 学号,sdept 系部,avg(sage) 平均年龄

from student

where sgentle='男'

group by sdept,sno

with cube


 

select sno 学号,sdept 系部,avg(sage) 平均年龄

from student

where sgentle='男'

group by sdept,sno

with rollup

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。