条件:表属性 A B,表1 表2
结果:以属性A为key,获取表1 2 中B值的总和 并依A排序
select A, sum(B) from ((select A,B from 表1) union all (select A,B from 表B)) result group by A order by A;
条件:表属性 A B,表1 表2
结果:以属性A为key,获取表1 2 中B值的总和 并依A排序
select A, sum(B) from ((select A,B from 表1) union all (select A,B from 表B)) result group by A order by A;
转载于:https://www.cnblogs.com/gengwudaxia/p/5193651.html