Suppose I have columns: run_id, time, distance
... and I want to just select the rows with the last time for each run_id. How do I do that?
You can create an indicator column using a formula. Be sure to sort (nested) by run_id and time first. The formula would be a simple Boolean result. Use the Lag() function as such: If( :run_id == Lag( :run_id, -1 ), 0, 1 ). Then you can select the rows where this column equals 1.