How might I list users that the system will soon delete?

Hi Amicable!

Using data explorer, the query would be:

WITH posts_by_user AS (
    SELECT COUNT(*) AS posts, user_id
    FROM posts
    GROUP BY user_id
)
SELECT 
    u.id,
    u.username_lower AS "username",
    u.created_at,
    u.last_seen_at
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