选择2列的总和以获取总价值

时间:2019-03-12 16:04:42

标签: sum

我正在尝试获取数据库中2个连接派生的2列的总和。我原本希望我的代码能产生结果,但是我认为我需要进行一些调整。

SELECT sum(AMT_COST) as COST, SUM(AMT_REV) as REV from cost_info_vw c inner join budget_vw b
on c.bline_bah_id = b.budg_id inner join new_info_vw a
on c.new_info_pid = a.line_id where dept_title = 'Accounting';

当前代码为COST和REV生成空值。任何帮助将不胜感激。

0 个答案:

没有答案
相关问题