query
#8

Quote:
Originally Posted by TTJJ
Посмотреть сообщение
Hi BaubaS,

When you say by money, I assume you mean you want to determine which player has X amount of money? If so you can use the following:
PHP код:
SELECT `column_nameFROM `table_nameWHERE money '%d' 
"%d" obviously being the amount of money, however if you are looking to see how many people have X amount of money, you would do the following:
PHP код:
SELECT COUNT(id) AS count FROM `table_nameGROUP BY money 
Hope it helped.

Cheers,

TJ

EDIT: I think I actually understand a little better, you want to rank the players in order of money. In which case you would use the following:

PHP код:
SELECT name FROM `table_nameORDER BY money DESC 
This query would return a list of players in order of money from highest to lowest, the first result would be the player who currently has the most amount of money.
Thanks for trying to help, but you haven't got the point. I want to get certain player (for example - player a) rank for example by money.

Quote:

EDIT: I think I actually understand a little better, you want to rank the players in order of money. In which case you would use the following:

PHP код:
SELECT name FROM `table_nameORDER BY money DESC 
This is very same what do I need ,but I need to get certain player rank, not to rank all players.
Reply


Messages In This Thread
rank - by BaubaS - 12.03.2012, 13:02
Re: query - by BaubaS - 12.03.2012, 18:26
Re: query - by Vince - 12.03.2012, 18:41
Re: query - by MP2 - 12.03.2012, 19:19
Re: query - by BaubaS - 12.03.2012, 19:53
Re: query - by BaubaS - 13.03.2012, 10:43
Re: query - by TTJJ - 13.03.2012, 10:49
Re: query - by BaubaS - 13.03.2012, 10:55
Re: query - by TTJJ - 13.03.2012, 11:24
Re: query - by BaubaS - 13.03.2012, 12:16

Forum Jump:


Users browsing this thread: 2 Guest(s)