Исходя из вашего предыдущего вопроса, попробуйте:
SELECT p.id AS post_id,
p.author_id AS post_author_id,
p.created_date AS post_created,
c.author_id AS comment_author_id,
c.created_date AS comment_created,
p.title,
c.content,
coalesce(c.created_date,p.created_date) AS sort_date
FROM Posts p
LEFT JOIN Comments c ON p.id = c.post_id
WHERE p.author_id = $userId
UNION ALL
SELECT p.id AS post_id,
p.author_id AS post_author_id,
p.created_date AS post_created,
c.author_id AS comment_author_id,
c.created_date AS comment_created,
p.title,
c.content,
c.created_date AS sort_date
FROM Posts p
RIGHT JOIN Comments c ON p.id = c.post_id
WHERE c.author_id = $userId
ORDER BY sort_date