I have a sqlite3 database with a table called PR (it is for personal records in workouts)
this table contains an exercise_id, and the weight associated with the PR
exercise_id | weight
------------|-------
0 | 90
1 | 100
0 | 120
1 | 140
2 | 70
------------|-------
What query can I use to get the maximum weight for each exercise_id, i.e. The query should return something like
0|120
1|140
2|70
I have tried the query SELECT exercise_id, MAX(weight), time FROM PR
, but it will only return the exercise_id and weight of the highest weight, in this case 1|140
.