May-17-2019, 06:09 AM
Hi,
I am tring to use sqlite3 in python. So far I have got it working and can display values. However, when I try displaying it in descending order, it works with 1 digit numbers, but when a value has 2 digits, it will only count the first digit.
This is the code I use to display the values:
Thanks.
I am tring to use sqlite3 in python. So far I have got it working and can display values. However, when I try displaying it in descending order, it works with 1 digit numbers, but when a value has 2 digits, it will only count the first digit.
This is the code I use to display the values:
for row in c.execute('SELECT * FROM scores ORDER BY score1 DESC LIMIT 5'): print (row)The output ends up being:
Output:('Michael', '8')
('Jim', '2')
('Tim', '2')
('James', '2')
('Chris', '19')
However, I want it to put the highest numbers at the top and not just take the first digit into account.Thanks.