• One option is to use a derived table containing the key + max(ship_date) and then delete from your table the rows that don't match as so:

    DELETE Orders

    --select *

    FROM Orders t

    LEFT OUTER

    JOIN (SELECT Order_No ,Line_No, Ship_Date = MAX(Ship_Date) FROM Orders GROUP BY Order_No ,Line_No) s

    ON t.Order_No = s.Order_No

    AND t.Line_No = s.Line_No

    AND t.Ship_Date = s.Ship_Date

    WHERE s.Ship_Date IS NULL