I have a table that has 5 columns for balances of 5 different accounts a customer holds. So the table looks as follows
CustID Acct1 Bal1 Acct2 Bal2 Acct3 Bal3 Acct4 Bal4 Acct5 Bal5
I need to write a query that returns all the custID's and the maximum balance of all the accounts. The resultset should look as follows
I know that MAX cannot be used in this case as it finds the max within a column. I need to find the max within a row. How can this be done? Please help.