Oracle的分析函数
select id,area,stu_type,sum(score) score from students group by rollup(id,area,stu_type) order by id,area,stu_type; //--------理解rollupselect a, b, c, sum( d ) from t group by rollup(a, b, c); 等效于 select * from ( select a, b, c, sum( d ) from t group by a, b, c union all select a, b, null, sum( d ) from t group by a, b union all select a, null, null, sum( d ) from t group by a union all select null, null, null, sum( d ) from t ) GROUP BY的3个扩展分析函数: ROLLUP,CUBE,GROUPING S