我有以下用于
的SQL查询SELECT ac.Source_and,
ac.Location_spending,
ac.type,
Sum( ac.balance ) -
coalesce( (SELECT Sum( ac.balance )
FROM Account ac cost
WHERE (ac.type = 0)
and (cost.Creditor_Account = income.Location_spending)
GROUP BY ac.Source , ac.Creditor_Account, ac.type)
,0)
FROM Account ac income
WHERE ac.type = 1
GROUP BY ac.Source_and , ac.Location_spending, ac.type
但它返回以下异常:
[88,88]子表达式中缺少右括号 [88,88] COALESCE表达式中缺少右括号 [217,315]查询包含格式错误的结尾。
它出了什么问题?