Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
RiazACU
.
Toggle Highlighting
SQL
SELECT old_user.user_name AS old_user_name, renamed.new_user_name AS new_user_name, p.page_title AS subpage_title FROM user old_user JOIN page p ON p.page_title LIKE CONCAT(old_user.user_name, '/%') JOIN ( SELECT REPLACE(log_title, '_', ' ') AS old_user_name, SUBSTRING_INDEX(SUBSTRING_INDEX(log_params, '\n', -1), '=', -1) AS new_user_name FROM logging WHERE log_type = 'renameuser' ) renamed ON old_user.user_name = renamed.old_user_name WHERE p.page_namespace = 2 AND NOT EXISTS ( SELECT 1 FROM page p2 WHERE p2.page_namespace = 2 AND p2.page_title = p.page_title AND p2.page_title LIKE CONCAT(renamed.new_user_name, '/%') ) ORDER BY old_user.user_name, p.page_title;
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...