Created
May 20, 2014 19:57
-
-
Save niisar/b1d1ab70b1c0af57c877 to your computer and use it in GitHub Desktop.
grouping sets example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select SURVEY_YEAR, | |
candybar_name, | |
gender, | |
overall_rating, | |
sum(number_bars_consumed) as total_bars_consumed | |
from CANDYBAR_CONSUMPTION_DATA | |
group by grouping sets ( | |
(SURVEY_YEAR,candybar_name,gender,OVERALL_RATING), | |
(SURVEY_YEAR,candybar_name,gender), | |
(SURVEY_YEAR,candybar_name), | |
(SURVEY_YEAR), | |
() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment