-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDimProduct.sql
More file actions
19 lines (19 loc) · 801 Bytes
/
Copy pathDimProduct.sql
File metadata and controls
19 lines (19 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
SELECT [ProductKey]
,[ProductAlternateKey]
,[dps].[ProductSubcategoryKey] AS ProductSubCategoryKey
,[dps].[EnglishProductSubcategoryName] AS ProductSubCategory
,[dpc].ProductCategoryKey AS ProductCategoryKey
,[dpc].[EnglishProductCategoryName] AS ProductCategory
,[EnglishProductName] AS Product
,[SafetyStockLevel]
,[ReorderPoint]
,[DaysToManufacture]
,[EnglishDescription] AS [Description]
,[StartDate]
,[EndDate]
,ISNULL([Status],'Outdated') AS [Status]
FROM [dbo].[DimProduct] AS dp
left join [dbo].[DimProductSubcategory] AS dps
on [dp].[ProductSubcategoryKey]=[dps].[ProductCategoryKey]
left join [dbo].[DimProductCategory] AS dpc
on [dps].[ProductCategoryKey]=[dpc].[ProductCategoryKey]