Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * into Sprzedaz from FactInternetSales;
- select * into Promocje from DimPromotion;
- select * into Produkty from DimProduct;
- select * into Klienci from DimCustomer;
- set statistics io, time on
- select
- P.Color, K.EnglishEducation, PM.EnglishPromotionName,
- SUM(S.SalesAmount), SUM(TaxAmt)
- from Sprzedaz S
- join Produkty P on S.ProductKey = P.ProductKey
- inner join Klienci K on S.CustomerKey = K.CustomerKey
- join Promocje PM on S.PromotionKey = PM.PromotionKey
- where P.Color = 'Red'
- group by P.Color, K.EnglishEducation, PM.EnglishPromotionName
- order by PM.EnglishPromotionName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement