我有两个选择语句从1个表中收集数据,一个是总计select语句。任何人都可以协助我将它们合并为一个陈述吗?任何帮助表示赞赏
声明1
SELECT ClientId, ExternalBank, PlacementDate
FROM tblDepositTransactions where ID = 15
声明2
SELECT Sum(EffectiveAmount) AS RunningBalance
FROM tblDepositTransactions WHERE ID = 15 GROUP BY ID
答案 0 :(得分:1)
SELECT ClientId, ExternalBank, PlacementDate,(SELECT Sum(EffectiveAmount)
FROM tblDepositTransactions WHERE ID = 15 GROUP BY ID)as RunningBalance
FROM tblDepositTransactions where ID = 15