Ciao,
Sto cercando di filtrare moderatori/bot dal conteggio dei post. Ho provato a usare NOT IN come mostrato di seguito. Ho provato anche con gli ID utente ma sembra che nulla funzioni. Qualche aiuto?
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