Data Scrub - Duplicate Records
You did not specify your platform but it should be relatively easy to do that:

DELETE FROM mytable
 WHERE Status = 'R'
    OR Status = 'X'
    OR
    (
       Status = 'P'
       AND ID IN (SELECT ID FROM mytable WHERE Status = 'X')
    );


Here are some links you may find helpful:

DELETE

WHERE

IN

AND, OR, NOT