SQL
AخA
USE metawiki_p;
SELECT actor_name, REPLACE(log_title, "@global", "") AS username, log_timestamp, log_comment
FROM logging_compat
JOIN actor
ON log_actor = actor_id
AND actor_name LIKE "%(WMF)"
AND log_action = "setstatus"
AND log_params LIKE "%locked%"
JOIN centralauth_p.globaluser gu
ON REPLACE(gu.gu_name, " ", "_") = REPLACE(log_title, "@global", "")
AND gu.gu_name LIKE '%WMF)'
AND gu.gu_locked = 1
GROUP BY username
HAVING username NOT IN (
SELECT page_title
FROM page
JOIN categorylinks ON page_id = cl_from
AND cl_to = "Former_Wikimedia_Foundation_staff_accounts");
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.