将两列的总和与两个表的一个列对应 [英] Sum two columns that corresponds a agregate from a columns of two tables
本文介绍了将两列的总和与两个表的一个列对应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
昨天我发布了一个问题,该问题涉及表的各列之和。
给我的结果与您发布时的结果相同:
IDPARENT COLUMN_1 COLUMN_2
1 28.25 9.5
Yesterday I posted a question on which said sum of columns of a table. See here!
However, I got into some other complications. I have a second table that needs to have a column added in correspondence with the first.
Here's what I need:
The column 'sum2' is new and I am not able to sum it correctly!
解决方案
I'm not sure where the issue is, without seeing your code. I built a small sample in SQLFIddle:
It's giving me the same result as you have in your post:
IDPARENT COLUMN_1 COLUMN_2
1 28.25 9.5
这篇关于将两列的总和与两个表的一个列对应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文