Created
December 8, 2018 17:37
-
-
Save haydarai/5aa40a3e7e22d88ee47c850b9cc24a1f to your computer and use it in GitHub Desktop.
Web 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_desc, sum(wr_return_quantity) as quantity | |
from web_returns, date_dim, item, reason | |
where web_returns.wr_returned_date_sk = date_dim.d_date_sk | |
and web_returns.wr_item_sk = item.i_item_sk | |
and web_returns.wr_reason_sk = reason.r_reason_sk | |
group by cube(date_dim.d_year, item.i_item_sk, reason.r_reason_desc) | |
order by date_dim.d_year, i_item_sk, reason.r_reason_desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment