Database Reference
In-Depth Information
ON FS.TitleKey = DT.TitleKey
INNER JOIN DWPubsSales.dbo.DimDates AS DD
ON FS.OrderDateKey = DD.DateKey INNER JOIN DWPubsSales.dbo.DimPublishers AS DP
ON DT.PublisherKey = DP.PublisherKey
ORDER BY DP.PublisherName, [Title], [OrderDate]
The results now include data from all four tables, as shown in Figure 13-5 .
Figure 13-5. Adding data from DimPublishers
If our current query contains columns that are unimportant to our report, they can easily be excluded by
either deleting them or commenting them out. For this report we will not need the TitleKey, OrderNumber,
OrderDateKey, or StoreKey. We removed these four columns from the select list in Listing 13-9 by commenting
them out.
Listing 13-9. Removing Columns Not Needed for Our Query
SELECT
DP.PublisherName
, [Title] = DT.TitleName
, DT.TitleId
--, [Internal Data Warehouse Id] = FS.TitleKey
--, OrderNumber
--, OrderDateKey
, [OrderDate] = DD.[Date]
--, StoreKey
, SalesQuantity
FROM DWPubsSales.dbo.FactSales AS FS
 
Search WWH ::




Custom Search