This query is marked as a draft This query has been published by Achim55.

SQL

AخA
 
USE commonswiki_p;
SET @date = '20170501';
(SELECT CONCAT('# [[:Category:', REPLACE(log_title,'_',' '), ']]') AS catname FROM logging
WHERE log_namespace = 14
AND NOT EXISTS (SELECT 1 FROM page WHERE page_title = log_title AND page_namespace = 14) #not recreated
AND SUBSTR(log_timestamp, 1, 8) = @date
AND log_type = 'delete' AND log_action = 'delete'
AND log_title NOT LIKE 'Images_from_the_Geograph_British_Isles_project_needing_categories%'
) UNION
(SELECT CONCAT('# [[:Category:', REPLACE(log_title,'_',' '), ']]') AS catname FROM logging
WHERE log_namespace = 14
AND SUBSTR(log_timestamp, 1, 8) = @date
AND log_type = 'move'
);
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.

Checking query status...