Jump to content
  • 0

SQL - How to get list, descending


Hijirikawa

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

So I want to list 10 players who are in the top level ranking ,however this code only checks for level 99s, how do I make it so that it can also check for levels that are not 99 yet?

query_sql( "SELECT `base_level` FROM `char` WHERE `base_level` = 99",.@acclvl );

Because I need the NPC to display first 10 players to reach level 99 and if there is still none, it will display the highest level'd players (up to 10)

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   14
  • Joined:  11/17/17
  • Last Seen:  

Hi, try this code
 

query_sql( "SELECT `char_id`,`name`,`base_level` FROM `char` ORDER BY `base_level` DESC LIMIT 10",.@cid[0],.@name$[0],.@level[0]);


 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

Thanks! I will try it out and see what happens.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...