日期:2014-05-16 浏览次数:20473 次
SELECT a.id ,
a.kcsl ,
a.tm ,
b.mc ,
( SELECT SUM(b.cbj * a.kcsl)
FROM ckb AS a
INNER JOIN tmb AS b ON a.tm = b.tm
WHERE a.kcsl > 0
) AS zs
FROM ckb AS a
INNER JOIN tmb AS b ON a.tm = b.tm
WHERE a.kcsl > 0
--GROUP BY a.id ,
-- a.kcsl ,
-- a.tm ,
-- b.mc