Skip to content

Instantly share code, notes, and snippets.

@krschmidt
Created January 3, 2017 22:43
Show Gist options
  • Save krschmidt/38fee1358cc1a6bd9f7d9562b53766eb to your computer and use it in GitHub Desktop.
Save krschmidt/38fee1358cc1a6bd9f7d9562b53766eb to your computer and use it in GitHub Desktop.
Find Drupal users with the most revisions over a period of time
SELECT c.count,
users.name
FROM (SELECT Count(*) count,
uid
FROM node_revision
WHERE From_unixtime(timestamp) > Date_sub(Curdate(), INTERVAL 2 month)
GROUP BY uid) c,
users
WHERE c.uid = users.uid
ORDER BY count;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment