with AST AS
(
SELECT "检测项目",
cast(sum("不良数量") AS DECIMAL(18,2)) AS 不良数量,
cast(sum("检测数量") AS DECIMAL(18,2))AS 检测数量
FROM "tbl_质检项目科目"
group by 检测项目
)
select 检测项目,
AST.不良数量,
AST.检测数量,
cast(((AST.不良数量)/AST.检测数量) AS DECIMAL(18,2))+0 AS 不良率
from AST
结果返回是零无语。。。是哪里有问题?
|