Human-driven copy-paste spam

Last 500 posts that were edited by TL0/TL1 users

SELECT
  p.id AS post_id,
  topic_id
FROM posts p
  JOIN users u
    ON u.id = p.user_id
  JOIN topics t
    ON t.id = p.topic_id
WHERE p.last_editor_id = p.user_id
  AND p.self_edits > 0
  AND (u.trust_level = 0 OR u.trust_level = 1)
  AND p.deleted_at IS NULL
  AND t.deleted_at IS NULL
  AND t.archetype = 'regular'
ORDER BY p.updated_at DESC
LIMIT 500

This query should do it, it lists recent posts that have been edited by the OP if the the user has a trust level of 0/1.
Shoutout to @simon for helping me finish this query!

12 Likes