07.07.2015, 19:57
Hey lads,
let's say there are 3 rows in the table:
Now, for example, I want to get the highest Money and WantedLevel values stored in the database.
so I'd do it this way:
and it'd give 40000, 50
But how do I also get the Name, which has the biggest Money and WantedLevel values? That the output would be Test2 - 40000, Test3 - 50
Is it possible to do it in the same query posted above? Or do I also to send several other queries, such like:
etc.?
Thanks!
let's say there are 3 rows in the table:
Код:
Name ------ Money ------ WantedLevel Test ------ 1000 ------ 11 Test2 ------ 40000 ------ 20 Test3 ------ 1337 ------ 50
so I'd do it this way:
Код:
SELECT MAX(Money), MAX(WantedLevel) FROM `table`
But how do I also get the Name, which has the biggest Money and WantedLevel values? That the output would be Test2 - 40000, Test3 - 50
Is it possible to do it in the same query posted above? Or do I also to send several other queries, such like:
Код:
SELECT `Name` FROM `table` WHERE `WantedLevel` = 40000
Thanks!