Skip to content

Instantly share code, notes, and snippets.

@niisar
Created May 20, 2014 19:59
Show Gist options
  • Save niisar/5b278c3751ef849ff6ab to your computer and use it in GitHub Desktop.
Save niisar/5b278c3751ef849ff6ab to your computer and use it in GitHub Desktop.
rollup example
select SURVEY_YEAR,
candybar_name,
gender,
overall_rating,
sum(number_bars_consumed) as total_bars_consumed
from CANDYBAR_CONSUMPTION_DATA
group by rollup(SURVEY_YEAR,candybar_name,gender,OVERALL_RATING);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment