I have a table called UserWorkouts that has amongst others, the following columns;
I am trying to create a ‘Leaderboard’ using an API. What I want to pull from this table, is the best result (i.e. greatest distance) for each type of workout (say A, B, or C) for each user (i.e. ownerId). And then sort them by greatest distance to smallest.
I have previously used a service to get around pagination (to bring back +100 records), so I am trying to adapt that method but not having much joy.
In my method, am I able to have multiple whereClauses? I cannot figure out how to put multiple clauses into codeless (I have created them but cannot wedge them in!?!??!)
Also, in terms of sorting by distance (that is easy) but how would I go about only bringing back 1 record per ownerId? I am assuming if I sort by distance and then remove ‘duplicates’, I will be left with the greatest distance record…not sure if that is possible in codeless?