I have two tables with like below codes:
Table: Accounts
id | username | email | registered
1 | player1 | 123@asd.ad| 2012-05-03
2 | goodman | 1345@bs.ad| 2012-06-03
3 | goodbat | asdh@asd.d| 2012-06-05
table:characters
guid | account | name | rank
213 | 1 | fres | 2
214 | 2 | sdg2 | 3
215 | 1 | fgax | 4
216 | 3 | zFvx | 8
217 | 3 | zsvx | 2
...
I want to show accounts with their highest rank character with just one Query .
output (Show Accounts with their Highest rank character)
username : player1 | 123@asd.ad | char: fgax(4)
username : goodman | 1345@bs.ad | char: sdg2(3)
username : goodbat | 134s@bs.ad | char: zFvx(8)
...
My Query:
SELECT username,email,id FROM accounts