Skip to content

Instantly share code, notes, and snippets.

@bifacil
Created August 11, 2019 01:20
Show Gist options
  • Save bifacil/c9f418785c2815dfafc237b6ed7a0dd9 to your computer and use it in GitHub Desktop.
Save bifacil/c9f418785c2815dfafc237b6ed7a0dd9 to your computer and use it in GitHub Desktop.
-- "Good code is its own best documentation." - Steve McConnell
LOAD dwh.DimProducts WITH SCD1
SELECT
#ProductID,
Product.Name Product,
ProductCategory.name ProductCategory,
ProductSubCategory.name ProductSubCategory,
ProductNumber,
ProductModel.name ProductModel,
Color,
StandardCost,
ListPrice,
Size,
SizeUnitMeasureCode,
Weight,
WeightUnitMeasureCode,
ProductLine,
DiscontinuedDate,
MakeFlag,
FinishedGoodsFlag
FROM staging.Product
LEFT JOIN staging.ProductSubCategory USING ProductSubcategoryID
LEFT JOIN staging.ProductCategory USING ProductSubCategory(ProductCategoryId)
LEFT JOIN staging.ProductModel USING ProductModelID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment