📜  优化销售查询的 TSQL 代码片段 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:54.651000             🧑  作者: Mango

代码示例1
SELECT
    'Customer'[Company Name], 
    'Date'[Date], 
    'Product'[Color],
    SUM ( 'Sales'[Quantity] )
FROM 'Sales'
    LEFT OUTER JOIN 'Customer' ON 'Sales'[CustomerKey] = 'Customer'[CustomerKey]
    LEFT OUTER JOIN 'Date' ON 'Sales'[OrderDate] = 'Date'[Date]
    LEFT OUTER JOIN 'Product' ON 'Sales'[ProductKey] = 'Product'[ProductKey];