t.user_id를 포함하면 해당 사용자가 OP(첫 번째 게시자)이기도 한 게시글만 반환됩니다. 이것이 주요 문제일 수 있을까요?
다음과 같이 유용할 수 있는 몇 가지 추가 사항도 발견했습니다.
-- [params]
-- user_id :user
SELECT t.id AS topic_id,
t.title,
p.raw as text,
p.created_at as dateposted
FROM posts p
JOIN topics t ON t.id = p.topic_id
WHERE t.archetype != 'private_message'
AND p.post_type IN (1, 4)
AND p.user_id = :user
AND t.deleted_at ISNULL
AND p.deleted_at ISNULL
ORDER BY p.created_at