Filter mods/bots from post_count?


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?

distinct( as topic_id,
t.posts_count as comments

FROM topics t
LEFT JOIN posts p ON = p.topic_id and t.user_id = p.user_id
LEFT JOIN users u ON =

WHERE t.category_id IN (20,21,5,7,9,11)
AND 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 asc

Still need help with this. Not sure if there’s any other information thats needed for assistance.

The query is supposed to count all unique posters under a topic excluding users who are mods/admin, as well as bots. However, I am not sure how to filter out staff and bots from post_count.

Hopefully this makes it more clear with how its supposed to work and what isnt working.