SQL Query to sum fields from different tables

前端 未结 5 1353
無奈伤痛
無奈伤痛 2020-12-30 15:57

I\'m a humble programmer that hates SQL ... :) Please help me with this query.

I have 4 tables, for example:

Table A:
Id Total
1  100
2  200
3  500

         


        
5条回答
  •  不思量自难忘°
    2020-12-30 16:07

    This might help other users.

    SELECT Total=(Select Sum(Amount) from table a)+(Select Sum(Amount) from table b)+(Select Sum(Amount) from table c)
    

提交回复
热议问题