SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 11/12/2019, 11:59 PM   #1
Huge Clucker
ApolloScripter's Avatar
Join Date: Sep 2018
Posts: 230
Reputation: 7
Default [SQLite] Sorting

It is not very clear to me, I have not found a tutorial that says something about, if anyone can explain me, or has the link of some, please send me.

How do I do a query on a table that returns the top 5 players (based on score field) in DB in descending order, but I need the names too, how i do this using Statements?
ApolloScripter is offline   Reply With Quote
Old 12/12/2019, 06:05 AM   #2
Joe Staff
Join Date: Aug 2007
Posts: 2,593
Reputation: 379
Default Re: [SQLite] Sorting

A quick search pulled this up:

Select name, score from table order by score desc
Joe Staff is offline   Reply With Quote
Old 12/12/2019, 09:55 AM   #3
Huge Clucker
=KempeR='s Avatar
Join Date: Oct 2011
Location: Kyiv, Ukraine
Posts: 258
Reputation: 8
Default Re: [SQLite] Sorting

The previous answer is not bad.
But if several players can have the same score, then you can select players according to the top 5 score values. Check out this fiddle.
Dafuq am I still doing in SA-MP in 2019?

Sincerely, Kemper
=KempeR= is offline   Reply With Quote
Old 12/12/2019, 09:49 PM   #4
Little Clucker
Join Date: Nov 2019
Posts: 21
Reputation: 0
Default Re: [SQLite] Sorting

Is this for Pawn or for PHP to display it on a website?
Danbo7 is offline   Reply With Quote

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Symon Scripting Help 1 27/09/2019 02:24 PM
Sorting bug Kraeror Scripting Help 10 17/11/2017 02:52 PM
Sorting Lists lavamike Scripting Help 2 19/02/2013 05:38 PM
Sorting Matz Scripting Help 0 26/12/2012 12:11 PM
Help with sorting cloud9 Help Archive 3 12/07/2010 10:19 AM

All times are GMT. The time now is 03:50 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.