Created
December 8, 2018 18:01
-
-
Save haydarai/f38e8c1c0f85afe9ab0f69e2d953eb72 to your computer and use it in GitHub Desktop.
Catalog 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(catalog_returns.cr_return_quantity) as quantity | |
from catalog_returns, date_dim, item, reason | |
where catalog_returns.cr_returned_date_sk = date_dim.d_date_sk | |
and catalog_returns.cr_item_sk = item.i_item_sk | |
and catalog_returns.cr_reason_sk = reason.r_reason_sk | |
group by cube(date_dim.d_year, item.i_item_sk, reason.r_reason_sk) | |
order by date_dim.d_year, item.i_item_sk, reason.r_reason_sk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment