在下面的查詢中,我選擇當前庫存的產品。現在如果庫存爲null,我想替換爲0。請幫我做這件事。如果在sql服務器中的值爲0,則爲0
SELECT p.ProductID,
p.ProductName,
(SELECT ISNULL(CurrentStock,0.00)
FROM Productstatus PS
WHERE PS.ProductID =p.ProductID
AND PS.LocationID = 1
AND PS.StatusDateTime= '2014-08-27'
and PS.productid=p.productid) CurrentStock
FROM Product P
LEFT OUTER JOIN LocationProductMap LMP ON LMP.ProductID=P.ProductID
WHERE LMP.ProductInFlow=1