HiveSQL:gouping sets

https://blog.csdn.net/MOUNINGA/article/details/99408470?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-6.baidujsUnder6&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-6.baidujsUnder6

基于group by 中的列,grouping sets 可以组合列,输出不同分组的聚合结果
group by col1, col2

grouping sets ((col1), (col2), (col1, col2), ())

你可能感兴趣的:(HiveSQL:gouping sets)