Fork of
Permissions - Inactive 12+ months
by Hey man im josh
This query is marked as a draft
This query has been published
by Queen of Hearts.
SQL
AخA
SELECT user_name, user_editcount, user_registration, rev_timestamp AS 'Last edit', GROUP_CONCAT(ug1.ug_group) AS 'user_groups'
FROM `user`
LEFT JOIN user_groups ug1
ON user_id = ug1.ug_user AND ug1.ug_group IN ('abusefilter', 'abusefilter-helper', 'templateeditor', 'accountcreator', 'zbureaucrat', 'checkuser', 'eventcoordinator', 'import', 'massmessage-sender', 'oversight', 'transwiki', 'extendedmover', 'patroller', 'interface-admin', 'researcher', 'zipblock-exempt', 'zfilemover')
JOIN actor
ON actor_user = user_id
JOIN revision_userindex
ON rev_id = (SELECT rev_id FROM revision_userindex
WHERE actor_id = rev_actor
ORDER BY rev_timestamp DESC
LIMIT 1)
WHERE rev_timestamp < (DATE_FORMAT((NOW() - INTERVAL 365 DAY),'%Y%m%d%H%i%S'))
AND ug1.ug_group IS NOT NULL
GROUP BY user_name
ORDER BY rev_timestamp
;
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.