SQL
x
/*IP edits in a month: reverted and total*/
/*ct_tag_id in (58,59) = revert and manual revert*/
SET @from = "20240304";
SET @to = DATE_FORMAT(@from + INTERVAL 1 MONTH, "%Y%m%d");
/*SELECT @from, @to;*/
SELECT count(DISTINCT rev_id) FROM revision
JOIN change_tag ON rev_id = ct_rev_id
JOIN actor ON actor_id = rev_actor
WHERE
actor_user is NULL
AND ct_tag_id in (58,59) /*revert and manual revert*/
AND rev_timestamp BETWEEN @from AND @to
;
SELECT count(rev_id) FROM revision
JOIN actor ON actor_id = rev_actor
WHERE
actor_user is NULL /*IP*/
AND rev_timestamp BETWEEN @from AND @to
;
/*
SELECT *, ct_tag_id in (58,59) as reverted FROM revision, change_tag, actor, page WHERE
rev_id = ct_rev_id
AND actor_id = rev_actor
AND page_id = rev_page
AND actor_user is NULL
AND ct_tag_id in (58,59)
AND rev_timestamp BETWEEN @from AND @to
ORDER BY rev_id DESC LIMIT 150 ;
SELECT rev_id FROM revision, actor, page WHERE
actor_id = rev_actor
AND page_id = rev_page
AND actor_user is NULL
AND rev_timestamp BETWEEN @from AND @to
ORDER BY rev_id DESC LIMIT 150 ;
*/
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.