Sum two columns that corresponds a agregate from a columns of two tables

柔情痞子 提交于 2019-12-13 05:15:14

问题


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!


回答1:


I'm not sure where the issue is, without seeing your code. I built a small sample in SQLFIddle:

SQLFiddle

It's giving me the same result as you have in your post:

IDPARENT    COLUMN_1    COLUMN_2
1            28.25          9.5


来源:https://stackoverflow.com/questions/19008870/sum-two-columns-that-corresponds-a-agregate-from-a-columns-of-two-tables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!