dbTalk Databases Forums  

SELECT until

comp.databases.mysql comp.databases.mysql


Discuss SELECT until in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
antonrifco
 
Posts: n/a

Default Re: SELECT until - 02-08-2010 , 12:55 PM






OP:
I assume your problem is similar with my case, which is :
MMORPG with about 1giga player with three attributes
(agility,strength,intel).
For each attribute the possible values are 0 to 99 (with interval
0,1).

Based on user's selected attribute, I want to show the user at which
position he/she is in the game.
For example: my strength is 20.56 and based on strength I am ranked 60
on the list.

For this problem you can solve wtih two query.
First.
Select count(1) from player where str < 20.56

Put the result in var a.

Then second query :
select count(1) from player where str = 20.56
Put the result in var b

So my ranking is ranged from a to (a+b)

Nb: you can also modify second query using order by user_id asc

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.