General functions
Commonly used functions for data processing.
GROUPING SETS ( GROUP BY GROUPING SETS (<groupsets>) )
> select count(cc_company) as total_count, cc_county, cc_class
from call_center
where cc_county in ('Williamson County', 'Bronx County', 'Huron County')
group by grouping sets (cc_county, cc_class);
# | total_count | cc_county | cc_class
1 | 2 | Williamson County | null
2 | 3 | Bronx County | null
3 | 1 | Huron County | null
4 | 2 | null | large
5 | 4 | null | medium ROLLUP ( GROUP BY ROLLUP <groupRollup> )
> select count(cc_company) as total_count, cc_county, cc_class
from call_center
where cc_county in ('Williamson County', 'Bronx County', 'Huron County')
group by rollup (cc_county, cc_class);
# | total_count | cc_county | cc_class
1 | 2 | Williamson County | null
2 | 3 | Bronx County | null
3 | 1 | Huron County | null
4 | 2 | Williamson County | large
5 | 3 | Bronx County | medium
6 | 1 | Huron County | medium
7 | 6 | null | null CUBE (GROUP BY CUBE <groupCube>)
EXCEPT ( <column> )
EXCEPT SET OPERATOR
Last updated
