delete from tb_aftermarket where order_number in ( select order_number from tb_aftermarket group by order_number having count(order_number) > 1 ) and id not in ( select min(id) from tb_aftermarket group by order_number having count(order_number ) > 1 )