Hey,
I’m trying to filter out moderators/bots out of post_count. I’ve tried using NOT IN as shown below. I’ve tried with the user ids as well but nothing seems to work. Any help?
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