こんにちは。
post_count からモデレーター/ボットを除外しようとしています。以下に示すように NOT IN を試しましたが、ユーザー 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