In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Sum by job and deptno respectively
Select sum (sal), job,deptno from emp group by grouping sets (job,deptno)
2. 2 ^ n-1 grouping (n represents the number of columns, if there are multiple columns enclosed in parentheses to calculate a column, for example: cube ((aprimeb), c) naught 2transfercube (amemeb) naught 2
Select sum (sal), deptno,job from emp group by cube (deptno,job)
Cube__ > 2 ^ n
-- group by 0
-- group by job
-- group by deptno
-- group by deptno,job
3. Nasty 1 grouping
Select sum (sal), deptno,job from emp group by rollup (deptno,job)
Rullup-- > nasty 1
-- group by deptno,job
-- group by deptno
-- group by 0
4. Detect whether to participate in the grouping grouping ()
Select sum (sal), deptno,job,grouping (deptno), grouping (job) from emp group by cube (deptno,job)
The result set 1 of the query indicates that there is no participation in the grouping; 0 indicates the participation score
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.