SELECT `xf_attachment`.*, `xf_attachment_data_Data_1`.*
FROM `xf_attachment`
LEFT JOIN `xf_attachment_data` AS `xf_attachment_data_Data_1` ON (`xf_attachment_data_Data_1`.`data_id` = `xf_attachment`.`data_id`)
WHERE (`xf_attachment`.`content_type` = 'post' AND `xf_attachment`.`content_id` IN (13287))
ORDER BY `xf_attachment`.`attach_date` ASC