The following SQL query:
SELECT messages.id, messages.created_at, comments.created_at FROM messages LEFT JOIN comments ON comments.message_id = messages.id