Answer the question
In order to leave comments, you need to log in
How can vkbottle bot display top 30 users from sqlite3?
I have many values, but they are used: nick, mess. So, I did the following to display the top:
tlist = db.execute('SELECT nick, mess FROM users ORDER BY mess DESC').fetchall()
for top in tlist:
print(top)
Answer the question
In order to leave comments, you need to log in
use the keyword limit .. offset ..
be careful, if two records have the same mess, the sort order will not be defined for them (in this case, I can recommend double sorting by mess and then, for example, by id)
1. Add to sqlLIMIT 30
I don't understand how to work with tuples in a tuple
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question