sql2005视图统计NULL值,用什么关键词改为数值
视图语句
SELECT c.branch, c.warehouseid, c.productsid, c.sumnownumber, c.sumthisnumber, p.codingen, p.name, p.units, p.specifications, p.model, p.merchandiseid,
p.recycle, c.faxprice, p.minimum, p.ceiling, p.coding, p.pinyin, c.sumplannumber,
(SELECT SUM(plannumber) AS numberplannumber
FROM dbo.stock_default AS d
WHERE (c.warehouseid = warehouseid) AND (c.productsid = productsid) AND (c.branch = branch) AND (type = 1) AND (recycle = 1))
AS numberplannumber,
(SELECT SUM(plannumber) AS numberyieldinplannumber
FROM dbo.view_yield_in AS d
WHERE (c.warehouseid = warehouseid) AND (c.productsid = productsid) AND (c.branch = branch) AND (recycle = 1)) AS numberyieldinplannumber,
(SELECT SUM(plannumber) AS numberyieldoutplannumber
FROM dbo.view_yield_out AS d
WHERE (c.warehouseid = warehouseid) AND (c.productsid = productsid) AND (c.branch = branch) AND (recycle = 1)) AS numberyieldoutplannumber,
(SELECT SUM(plannumber) AS numberstockinplannumber
FROM dbo.view_stock_in AS d
WHERE (c.warehouseid = warehouseid) AND (c.productsid = productsid) AND (c.branch = branch) AND (recycle = 1)) AS numberstockinplannumber,
(SELECT SUM(plannumber) AS numberstockinreturnplannumber
FROM dbo.view_stock_in_return AS d
WHERE (c.warehouseid = warehouseid) AND (c.productsid = productsid) AND (c.branch = branch) AND (recycle = 1))
AS numberstockinreturnplannumber,
(SELECT SUM(plannumber) AS numberstockoutplannumber
FROM dbo.view_stock_out AS d
WHERE (c.warehouseid = warehouseid) AND (c.productsid = productsid) AND (c.branch = branch) AND (recycle = 1))
AS numberstockoutplannumber,
(SELECT SUM(plannumber) AS numberstockoutreturnplannumber
FROM dbo.view_stock_out_return AS d
WHERE (c.warehouseid = warehouseid) AND (c.productsid = productsid) AND (c.branch = branch) AND (recycle = 1))
AS numberstockoutreturnplannumber
FROM dbo.products AS p INNER JOIN
dbo.view_stock_counts AS c ON p.productsid = c.productsid
isnull(列名,0)
[解决办法]
LS正解我蹭分