Created
December 8, 2018 17:52
-
-
Save haydarai/40b4289b9a0d0c7d63efd298cd44381a to your computer and use it in GitHub Desktop.
Store Returns
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 date_dim.d_year, item.i_item_sk, reason.r_reason_sk, sum(sr_return_quantity) as quantity | |
from store_returns, date_dim, item, reason | |
where store_returns.sr_returned_date_sk = date_dim.d_date_sk | |
and store_returns.sr_item_sk = item.i_item_sk | |
and store_returns.sr_reason_sk = reason.r_reason_sk | |
group by cube(date_dim.d_year, sr_item_sk, r_reason_sk) | |
order by date_dim.d_year, reason.r_reason.sk, item.i_item_sk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment