List record from table by selects MAX value

i have a table as following:


Now i want to list all account details in each branch with the highest balance, how should I write the sql statement?

Simply said, i just want to list out all the branches, with the account of having highest balance.


There are similar questions.

You can use analytic functions.

Try this if it works for you:

    select branch_code,acc_number,acc_balance from
        select distinct acc_number,branch_code,acc_balance, 
        max(acc_balance) over(partition by branch_code order by 1) as MAX 
        from Account

    where acc_balance=MAX

Need Your Help

Working with Collections - Arraylist , Sorted list, Dictionaryentry

c# arraylist collections sortedlist

Below is my Code : The problem is when I am adding SortedList collection to Arraylist and at the time of retrieval it(SortedList) converts to DictonaryEntry Strange. Can anybody explain? Thanks in

repaint() call from the constructor

java swing

I'm trying to display loaded resource-image.