So lets say i have 2 tables.
table users:
id | name | date
table weight_tracking;
id | user_id | previous_weight | current_weight | date
weight_tracking table is being updated daily with user current weight and previous_weight.
I am trying to display all users ordering by previous_weight – current_weight (so by the difference in weight – who ever lost the most weight will show up first)
Can that be done with 1 call ?
if a user can have more than one row in weight_tracking table, you could use something like this: