Delete
from manual_redaction
where concat(annotation_id, file_id) in (SELECT concat(manual_redaction_entry_entity_annotation_id, id)
                                         from file file
                                                  JOIN manual_redaction_entry_entity_positions pos
                                                       ON file.id = pos.manual_redaction_entry_entity_file_id
                                         where file.number_of_pages < pos.page);