0

If I have a table with the columns:

branch-name
account-balance

Assuming there are more than one entries for branch-name and account-balance, how can I perform a query to show the average account balance for each branch-name?

Thanks.

user2975192
  • 317
  • 2
  • 6
  • 18
  • possible duplicate of [Select average from MySQL table with LIMIT](http://stackoverflow.com/questions/1854383/select-average-from-mysql-table-with-limit) – Shiva Jan 09 '14 at 00:08

2 Answers2

1
SELECT avg(account-balance) AS branchAverage, branch-name
FROM tableName
GROUP BY branch-name 
Digital Chris
  • 6,177
  • 1
  • 20
  • 29
-2

select branch_name from Account group by branch_name having avg(balance) >= all( select avg(balance) from Account group by branch_name);