I'm new to SQL and am currently learning and this is probably a fairly basic question:
I have 4 tables
1) Customer (customerName, street, customerCity)
2) Deposit (customerName, branchName, accountNumber, balance)
3) Loan (customerName, branchName, loanNumber, amount)
4) Branch (branchName, branchCity, assets)
WHERE balance > ALL;
You are looking for the customer(s) whose balance is greater than or equal to all balances in the table
so you just need to use
>= instead of
SELECT customerName FROM Deposit WHERE balance >= ALL (SELECT balance FROM Deposit);
Or you can use a correlated sub query and look for customers whose balances are greater than all other balance values.
SELECT customerName FROM Deposit d1 WHERE balance > ALL (SELECT balance FROM Deposit d2 WHERE d2.balance <> d1.balance);
In the event of ties both queries will return all customers with the highest amount.