Advertisement
Guest User

Untitled

a guest
May 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1.  
  2. select * into Sprzedaz from FactInternetSales;
  3. select * into Promocje from DimPromotion;
  4. select * into Produkty from DimProduct;
  5. select * into Klienci from DimCustomer;
  6.  
  7. set statistics io, time on
  8.  
  9. select
  10.   P.Color, K.EnglishEducation, PM.EnglishPromotionName,
  11.   SUM(S.SalesAmount), SUM(TaxAmt)
  12. from Sprzedaz S
  13.   join Produkty P on S.ProductKey = P.ProductKey
  14.   inner join Klienci K on S.CustomerKey = K.CustomerKey
  15.   join Promocje PM on S.PromotionKey = PM.PromotionKey
  16. where P.Color = 'Red'
  17. group by P.Color, K.EnglishEducation, PM.EnglishPromotionName
  18. order by PM.EnglishPromotionName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement