Skip to content

Instantly share code, notes, and snippets.

@atopal
Last active December 15, 2015 05:09
Show Gist options
  • Select an option

  • Save atopal/5206770 to your computer and use it in GitHub Desktop.

Select an option

Save atopal/5206770 to your computer and use it in GitHub Desktop.
number of edits to articles in certain time frame for certain user
SELECT `wiki_document`.`title` as doctitle, count(*) revisions
FROM `wiki_revision`
JOIN `wiki_document` on `wiki_revision`.`document_id`=`wiki_document`.`id`
JOIN `auth_user`on `wiki_revision`.`creator_id`=`auth_user`.`id`
WHERE `wiki_revision`.`created` >= '2010-01-01 0'
AND `wiki_revision`.`created` < '2013-01-01 0'
AND `wiki_document`.`locale` LIKE 'en-US'
AND `auth_user`.`username` LIKE 'verdi'
GROUP BY `wiki_document`.`title` ORDER BY revisions DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment