Getting the sum of several columns from two tables

前端 未结 5 481
生来不讨喜
生来不讨喜 2021-01-11 16:26

I want to get the sum of several columns from 2 different tables (these tables share the same structure).

If I only consider one table, I would write this kind of qu

5条回答
  •  星月不相逢
    2021-01-11 17:16

    SELECT (SELECT SUM(amount) from debit) as debitamounts, (SELECT SUM(amount) from credit) as creditamounts
    

提交回复
热议问题