SELECT * FROM
cl_post_attachments p
LEFT JOIN cl_courses_homeworks_attachments h
ON
p.attachment_to = h.attachment_to AND
p.attachment_target = h.attachment_target AND
p.attachment_target_item = h.attachment_target_item AND
p.attachment_from = h.attachment_from AND
p.attachment_author = h.attachment_author
WHERE h.attachment_id IS NULL
AND p.attachment_to = 15;
Activar servicio de corrección automática: https://iefc.classlife.education/fixhomeworkattachments