我正在尝试使用以下查询用 AdventureWorks 数据库中的数据填充我的产品维度
SELECT product.Class,
product.Color,
product.DaysToManufacture,
product.DiscontinuedDate,
product.ProductLine,
product.FinishedGoodsFlag,
product.ListPrice,
product.MakeFlag,
product.Name AS productName,
productDescription.[Description],
product.ProductNumber,
product.ReorderPoint,
product.SafetyStockLevel,
product.SellEndDate,
product.SellStartDate,
product.Size,
product.StandardCost,
product.Style,
product.[Weight],
model.Name AS model,
product.WeightUnitMeasureCode,
product.SizeUnitMeasureCode,
subcategory.Name AS subcategoryName,
category.Name AS categoryName,
photo.LargePhoto,
photo.LargePhotoFileName,
photo.ThumbNailPhoto,
photo.ThumbnailPhotoFileName
FROM AdventureWorks2008R2.Production.Product product
INNER JOIN AdventureWorks2008R2.Production.ProductModel model
ON (product.ProductModelID = model.ProductModelID)
INNER JOIN AdventureWorks2008R2.Production.ProductSubcategory subcategory
ON (subcategory.ProductSubcategoryID = product.ProductSubcategoryID)
INNER JOIN AdventureWorks2008R2.Production.ProductCategory category
ON (category.ProductCategoryID = subcategory.ProductCategoryID)
INNER JOIN AdventureWorks2008R2.Production.ProductProductPhoto productphoto
ON (productphoto.ProductID = product.ProductID)
INNER JOIN AdventureWorks2008R2.Production.ProductPhoto photo
ON (productphoto.ProductPhotoID = photo.ProductPhotoID)
INNER JOIN AdventureWorks2008R2.Production.ProductModelProductDescriptionCulture productModelDescription
ON (productModelDescription.ProductModelID = model.ProductModelID)
INNER JOIN AdventureWorks2008R2.Production.ProductDescription productDescription
ON (productModelDescription.ProductDescriptionID = productDescription.ProductDescriptionID)
WHERE productModelDescription.CultureID = 'en';
但是 Product 表中有 504 条产品记录,但此查询仅产生 294 条记录。查询了一段时间后,我发现连接获取产品描述是扣除产品记录数的原因。我的问题是如何在获取产品描述信息的同时获取所有产品记录(504),如果没有找到则放置 NULL