热门
最新
红包
立Flag
投票
同城
我的
发布
hive grouping_ID
等价于将不同维度的GROUP BY结果集进行UNION ALL
原文地址 https://www.cnblogs.com/qingyunzong/p/8798987.html
select
month,
day,
count(distinct cookieid) as uv,
GROUPING__ID
from cookie.cookie5
group by month,day
grouping sets (month,day)
order by GROUPING__ID;
等价于
SELECT month,NULL,COUNT(DISTINCT cookieid) AS uv,1 AS GROUPING__ID FROM cookie5 GROUP BY month
UNION ALL
SELECT NULL,day,COUNT(DISTINCT cookieid) AS uv,2 AS GROUPING__ID FROM cookie5 GROUP BY day
CSDN App 扫码分享
2
3
打赏
- 复制链接
- 举报
下一条:
求解