Created
August 11, 2019 12:47
-
-
Save bifacil/40848fc9dbde5f0f9bcd4b98e5c05503 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-- Ejemplo 1 | |
SELECT | |
DimProduct.EnglishProductName AS Producto, | |
sum(sales.OrderQuantity) AS Unidades, | |
sum(sales.SalesAmount) AS Importe, | |
Importe/Unidades AS [Precio Medio] | |
FROM FactResellerSales sales | |
INNER JOIN DimProduct USING ProductKey | |
INNER JOIN DimProductSubCategory USING DimProduct(ProductSubcategoryKey) | |
INNER JOIN DimProductCategory USING DimProductSubCategory(ProductCategoryKey) | |
INNER JOIN DimDate USING (OrderDateKey DateKey) | |
WHERE | |
DimProductCategory.SpanishProductCategoryName='Bicicleta' | |
AND DimDate.SpanishMonthName='Enero' | |
AND DimDate.CalendarYear=2008 | |
ORDER BY [Precio Medio] DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment