SQL 中ROLLUP、CUBE的用法和区别_西秋海棠-CSDN博客_ ...
文章推薦指數: 80 %
SQL中ROLLUP、CUBE的用法和区别
2016-10-1916:39:43
12115
分类专栏:
文章标签:
SQL中ROLLUP用法
ROLLUP运算符生成的结果集类似于CUBE运算符生成的结果集。
下面是CUBE和ROLLUP之间的具体区别:
CUBE生成的结果集显示了所选列中值的所有组合的聚合。
ROLLUP生成的结果集显示了所选列中值的某一层次结构的聚合。
ROLLUP优点:
(1)ROLLUP返回单个结果集,而COMPUTE
延伸文章資訊
- 1SQL Server ROLLUP By Practical Examples
The SQL Server ROLLUP is a subclause of the GROUP BY clause which provides a shorthand for defini...
- 2GROUP BY (Transact-SQL) - Microsoft Docs
Syntax for SQL Server and Azure SQL Database -- ISO-Compliant Syntax GROUP BY { column-expression...
- 3SQL ROLLUP - SQL Tutorial
Introduction to SQL ROLLUP. The ROLLUP is an extension of the GROUP BY clause. The ROLLUP option ...
- 4SELECT WITH ROLLUP - MariaDB Knowledge Base
Description. The WITH ROLLUP modifier adds extra rows to the resultset that represent super-aggre...
- 5MySQL GROUP BY ROLLUP 的應用- iT 邦幫忙::一起幫忙解決 ...
GROUP BY 的應用很廣泛,再搭配ROLLUP使用就更強大了. 先建立測試用的Table,為使討論的重點在ROLLUP上,故測試Table是簡化的,實務應用上 ...