如果我有一个包含列的表:
branch-name
account-balance
假设分支名称和帐户余额有多个条目,我如何执行查询以显示每个分支名称的平均帐户余额?
感谢。
答案 0 :(得分:1)
SELECT avg(account-balance) AS branchAverage, branch-name
FROM tableName
GROUP BY branch-name
答案 1 :(得分:-2)
从accountname中选择branch_name by branch_name avg(balance)> = all(从account_name中选择avg(余额)by branch_name);