def get_score_in(low, high):
conn = sqlite3.connect(db_file)
cursor = conn.cursor()
try:
cursor.execute(f"select name from user where (score between {low} and {high}) order by score")
values = cursor.fetchall()
except:
return []
finally:
cursor.close()
conn.close()
return [x[0] for x in values]
在路上Ce
documents:
https://www.tutorialspoint.com/sqlite/sqlite_select_query.htm
https://www.sqlite.org/lang_select.html