Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Mainspaces pages a user has deleted, and have been restored
by
RoySmith
This query is marked as a draft
This query has been published
by
RoySmith
.
Toggle Highlighting
SQL
SET @user = 'Ymblanter'; -- SET @user = 'RHaworth'; SET @user_id = ( SELECT actor_id FROM actor_logging WHERE actor_name = @user); SET @deleted = ( SELECT count(distinct(ll.log_title)) FROM logging_userindex lu JOIN logging_logindex ll ON lu.log_title = ll.log_title WHERE lu.log_actor = @user_id AND lu.log_namespace = 0 AND ll.log_namespace = 0 AND lu.log_type = 'delete' AND lu.log_action = 'delete'); SET @restored = ( SELECT count(distinct(ll.log_title)) FROM logging_userindex lu JOIN logging_logindex ll ON lu.log_title = ll.log_title WHERE lu.log_actor = @user_id AND lu.log_namespace = 0 AND ll.log_namespace = 0 AND lu.log_type = 'delete' AND lu.log_action = 'delete' AND ll.log_type = 'delete' AND ll.log_action = 'restore' AND ll.log_timestamp > lu.log_timestamp); SELECT @deleted, @restored, 100 * @restored / @deleted as percentage;
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...