嘿,
我正在尝试从 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