안녕하세요,
post_count에서 moderator/bot을 제외하려고 시도하고 있습니다. 아래에 표시된 대로 NOT IN을 사용했지만, user id를 사용해도 작동하지 않습니다. 도움을 주실 수 있나요?
SELECT
distinct(t.id) as topic_id,
t.posts_count as commentsFROM topics t
LEFT JOIN posts p ON t.id = p.topic_id and t.user_id = p.user_id
LEFT JOIN users u ON u.id = t.idWHERE t.category_id IN (20,21,5,7,9,11)
AND t.id NOT IN (17,19,21,23,6300,6301)
– AND strpos(t.title, ‘About the’) != 0
–AND u.username NOT IN (‘system’, ‘river’, ‘Pearson’)
order by t.id asc