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
DWalden (WMF)
.
Toggle Highlighting
SQL
SELECT foo.query FROM (SELECT EXTRACT(YEAR FROM log_timestamp) AS year, CONCAT("INSERT INTO logging (log_type, log_action, log_timestamp, log_actor, log_namespace, log_title, log_comment_id, log_params, log_deleted", IF(logging.log_page IS NULL, ")", ", log_page)"), " VALUES ", "('", CONCAT_WS("','", logging.log_type, logging.log_action, logging.log_timestamp, 1, logging.log_namespace, logging.log_title, 1, logging.log_params, 0, logging.log_page), "');") AS query, ROW_NUMBER() OVER(PARTITION BY year, log_action ORDER BY log_timestamp DESC) AS part FROM logging WHERE log_type = "gblblock" AND log_timestamp < 20120101000000) AS foo WHERE foo.part < 5;
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...