如何在 sql server 2008 的连接中使用 sum 函数?
SELECT SUM(d.TranTypeAmt),
h.LnNo,
h.LoanRcptAmt,
d.Trantype,
d.TranTypeAmt
FROM LGen_LnInstClln_h h
RIGHT OUTER JOIN LGen_LnInstClln_d d
ON h.PK_Id = d.InstCllnHdr_FK
WHERE h.LnNo = '40009'