将两个 table 中的列求和到具有两列的第三个 table

sum columns from two tables into third table with two columns

我是 MySQL 的新手。
我正在尝试从两个不同的 table 中的两列中获取汇总数据(浮点数),并创建第三个 table,总共有两列和一行,即总和 ... 这是我到目前为止得到的:

SELECT SUM(column_from_table1),
SUM(column_from_table2) 
From table1, table2 

它返回 2 列错误 numbers(sum)
我在哪里弄错了? 如果您需要更多数据来帮助我,请告诉我。

您的问题是,当您 select from table1, table2 时,会生成一个隐含的 join。使用 2 个查询,或使用子查询:

SELECT SUM(column_from_table1) AS SUM1,
       (SELECT SUM(column_from_table2) FROM table2) AS SUM2
From table1