I am missing something here. I have two tables: orders id delivery_route_segments id, order_id, position, completed I want to find the first uncompleted deliver_route_segment for each order, by position. Seems to me I ought to be able to do this: SELECT |