我坚持将空值更改为“0”我写了这样的代码
SELECT
Custom.tblR_docProducer.libtxtDocumentID AS ParentID,
Custom.tblR_docProducer_grdProductRating.grdProductName AS ProductName,
Custom.tblR_docProducer_grdProductRating.grdProductType AS CategoryID,
Custom.tblR_docProducer_grdProductRating.gdlkRating AS StarID,
Custom.tblR_docProducer_grdProductRating.gdlkRatingYear AS YearID,
1 AS DisplayOrder,
0 AS isDisabled
FROM Custom.tblR_docProducer
INNER JOIN Custom.tblR_docProducer_grdProductRating
ON Custom.tblR_docProducer.Id = Custom.tblR_docProducer_grdProductRating._Parent
结果仍为null
StarID
5
NULL
答案 0 :(得分:2)
使用IsNull
IsNull(Custom.tblR_docProducer_grdProductRating.gdlkRating, 0) AS StarID