查询结果A: names sale mike 10 查询结果B: names sale mike 10 请问,如何写SQL语句查询语句,能直接得出累加后的结果,例如: 得出查询结果C: names sale mike 20 或者查询结果D: names all_sale mike 20 小弟是初学者,还请多多帮忙,多谢。
表A 表B select ABC from A where ID=xxx select ABC from B where nane = xxx 求和 select sum(ABC) from (select ABC from A where ID=xxx union select ABC from B where nane = xxx)