car-index installed_date firebar-grade frame-grade CAR5 05-Jul-12 B A CAR3 31-Jan-12 A A CAR1 05-Apr-12 C C CAR1 24-May-12 D D CAR3 18-May-12 C C CAR1 08-Feb-12 C A CAR1 18-May-12 C B CAR5 24-May-12 D C CAR3 11-May-12 C B CAR5 22-Aug-12 B B CAR5 17-Sep-12 A B
car-index installed_date firebar-grade frame-grade CAR1 24-May-12 D D CAR3 18-May-12 C C CAR5 17-Sep-12 A B
select car_index, frame_grade, firebar_grade, max(installed_date) as recentdate from car group by car_index, frame_grade, firebar_grade;
select * from car c where c.installed_date = (select MAX(installed_date) from car cr where cr.[car-index] = c.[car-index])
SELECT C.car_index,MAX(C.firebar_grade),MAX(C.frame_grade) FROM Car C Group by C.car_index
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)