I have been trying to remove duplicates from my query results based on the time but I would need to consider 3 different times and i am not sure how to do that. As some of the testing happen multiple times, there are duplicates on the part_id and i would only like to have the last tested results from all the 3 tables.
I am running this query now
select lb.request_ky, lb.build_dm, lb.part_id, dv.date_test, dv.result, dw.date_test, dw.result, tt.date_test, tt.result From tableA lb, tableB dv, tableC dw, tableD tt Where lb.part_id = dv.part_id And lb.part_id = dw.part_id And lb.part_id = tt.part_id
This query would give me duplicates on the part id. How can i just get the latest result from each table and join them together?