I have these records
What I want is to find max value in balance and retrieve it with the associated name (I have foreign keys userid==balanceID), for example in this case it would be "name2 | 2000". Is here any Mysql'ist who could tell me how to achieve this?
I tried something similar to
SELECT MAX(b.balance), i.name
from balance b, usr i
WHERE i.userid=b.balanceID;
BUT it doesnt assign correct name to MAX value from balance. Any help?;]