📜  如何在SQL中获取具有相同ID和不同表的列的总和? - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:53.991000             🧑  作者: Mango

代码示例1
select t2.szCustId
     , t2.bAllowToCredit
     , sum(t1.decCreditLimit) as decCreditLimit 
from table1 t1
join table2 t2 on t1.szCustId = t2.szCustId
group by t2.szCustId
       , t2.bAllowToCredit