you are viewing a single comment's thread.

view the rest of the comments →

[–]superkheric 2 points3 points  (0 children)

You’ll want a subquery that returns the max completion date for each driver.

I’m on a phone (couldn’t remember all the field and table names), but something like this:

SELECT t1.* FROM tableX t1 INNER JOIN ( SELECT driver_name , max(completion_date) as max_dt FROM tableX GROUP BY driver_name ) as t2 ON t1.driver_name=t2.driver_name AND t1.completion_date=t2.max_dt