表 1
Name Marks a 65 b 40
表 2
Name Marks c 25 b 70
总和将为 (65+40+25+70) & MAX 将为 70
最佳答案
使用union all合并两个表然后应用聚合
select sum(marks), max(marks)
from
(select * from table1
union all
select * from table2)a
where marks>40
关于mysql - 通过在 SQL 中连接相同模式的 2 个表来查找列的总和和最大值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52114389/