热门
最新
红包
立Flag
投票
同城
我的
发布
CSDN App 扫码分享
评论
点赞
打赏
- 复制链接
- 举报
下一条:
hive grouping_ID 等价于将不同维度的GROUP BY结果集进行UNION ALL原文地址 https://www.cnblogs.com/qingyunzong/p/8798987.htmlselect month, day, count(distinct cookieid) as uv, GROUPING__IDfrom 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