摘要: 主要是GROUPING SETS和ROLLUP函数,具体意思不好说清楚,只能通过例子来学习。原表数据,如下图GROUPING SETS测试,下面两段代码运行结果是一样,select id,area,stu_type,sum(score) score from studentsgroup by grouping sets(id,area,stu_type)select a.id, null, null, sum( score ) from students a group by a.idunion allselect null, a.area, null, sum( score ) from s 阅读全文
posted @ 2013-05-21 15:51 无尽的缥缈 阅读(225) 评论(0) 推荐(0) 编辑