Pruning the users table I have a site that deals exclusively with user generated content.

After a few years, the users table is getting to a stage where it can probably be pruned of folk who have registered but not actually submitted any content.

What query would I run to show the users who have zero posts?

I thought something like select id from craft_users where id not in (select distinct authorId from craft_entries) would do it.

The distinct query certainly returns 1020 rows where we actually have around 1800 users.
Looks like this will do the trick

select * from craft_users
left join craft_entries on craft_users.id = craft_entries.authorId
where craft_entries.authorId is null and craft_users.id &lt;&gt; "1"