lundi 23 mars 2015

Sqlite: Get total top ten score from multiple columns

I have a table looking like:



ID Task Score
1 4 2
9 2 0
7 6 1
1 3 1
9 1 2


This goes on like this with around 200 rows. Notice how the same ID appears many times but with a different task number. I would like to add all of these scores together for each ID and then take the total value for each ID and output the top 10. I'm looking for a SQL-command to do this, ofcourse i could do this by reading the tables and calculate it in the Python language. But that is not the way i wan't to do it by.


Is this possible, if so how?


Aucun commentaire:

Enregistrer un commentaire