Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT dw.IDWaktu, dp.IDProduct, dsm.IDShip, dv.IDVendor, dum.IDMeasure, poh.SubTotal,
- pod.OrderQty, pod.StockedQty
- FROM DimensiWaktu dw, AdventureWorks2017.Purchasing.PurchaseOrderHeader poh,
- DimensiProduct dp, AdventureWorks2017.Purchasing.PurchaseOrderDetail pod, DimensiShip dsm, DimensiVendor dv,
- AdventureWorks2017.Production.Product p,
- DimensiMeasure dum
- WHERE
- YEAR(poh.OrderDate) * 10000 +
- MONTH(poh.OrderDate) * 100 +
- DAY(poh.OrderDate) = dw.IDWaktu AND
- poh.PurchaseOrderID = pod.PurchaseOrderID AND
- pod.ProductID = dp.ProductID AND
- dum.UnitMeasureCode = p.SizeUnitMeasureCode AND
- poh.ShipMethodID = dsm.ShipMethodID AND
- poh.VendorID = dv.BusinessEntityID
- Vendor
- SELECT DISTINCT YEAR(ModifiedDate) * 10000 +
- MONTH(ModifiedDate) * 100 +
- DAY(ModifiedDate) AS IDWaktu,
- ModifiedDate AS date,
- Day(ModifiedDate) As day,
- Month(ModifiedDate) AS month,
- Year(ModifiedDate) AS year
- FROM AdventureWorks2017.Purchasing.Vendor sm LEFT JOIN eduardo_OLAP.dbo.DimensiWaktu dw
- ON sm.ModifiedDate = dw.date
- WHERE dw.date IS NULL
- Product
- SELECT DISTINCT YEAR(ModifiedDate) * 10000 +
- MONTH(ModifiedDate) * 100 +
- DAY(ModifiedDate) AS IDWaktu,
- ModifiedDate AS date,
- Day(ModifiedDate) As day,
- Month(ModifiedDate) AS month,
- Year(ModifiedDate) AS year
- FROM AdventureWorks2017.Production.Product sm RIGHT JOIN eduardo_OLAP.dbo.DimensiWaktu dw
- ON sm.ModifiedDate = dw.date
- WHERE dw.date IS NULL
- Ship
- SELECT DISTINCT YEAR(ModifiedDate) * 10000 +
- MONTH(ModifiedDate) * 100 +
- DAY(ModifiedDate) AS IDWaktu,
- ModifiedDate AS date,
- Day(ModifiedDate) As day,
- Month(ModifiedDate) AS month,
- Year(ModifiedDate) AS year
- FROM AdventureWorks2017.Purchasing.ShipMethod sm RIGHT JOIN eduardo_OLAP.dbo.DimensiWaktu dw
- ON sm.ModifiedDate = dw.date
- WHERE dw.date IS NULL
- Measure
- SELECT DISTINCT YEAR(ModifiedDate) * 10000 +
- MONTH(ModifiedDate) * 100 +
- DAY(ModifiedDate) AS IDWaktu,
- ModifiedDate AS date,
- Day(ModifiedDate) As day,
- Month(ModifiedDate) AS month,
- Year(ModifiedDate) AS year
- FROM AdventureWorks2017.Production.UnitMeasure sm LEFT JOIN eduardo_OLAP.dbo.DimensiWaktu dw
- ON sm.ModifiedDate = dw.date
- WHERE dw.date IS NULL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement