WITH posts_by_user AS (
SELECT COUNT(*) AS posts, user_id
GROUP BY user_id
u.username_lower AS "username",
FROM users u
LEFT JOIN posts_by_user pbu ON pbu.user_id = u.id
WHERE u.active = true and u.trust_level = 0
AND posts IS NULL
ORDER BY u.id
But the wider use case is maybe interesting. We use email digests quite a lot because some of our community are valued but busy older people unlikely to post and less likely to log in. But they are very familiar with email and they like to remain updated.
But suddenly after 2 years and we can’t get back in touch with them.
yes, exactly. It would be nice if they posted once. But imagine someone extremely time poor and really bad with technology. Yet highly valued. The digests are superb for them and the community knows they belong & doesn’t mind they don’t actively contribute online.