delete from workstation_components where workstationauditid in (select b.workstationauditid from workstation_components b, workstation_audit_history a where a.workstationauditid = b.workstationauditid and a.workstationauditid < (select max(workstationauditid from workstation, audit_history where ws_num = a.ws_num