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
Nux
.
Toggle Highlighting
SQL
USE plwiki_p; -- Re-format wikitable: `(\d+)\.0\|\|(\S[^|]+)` -- Replace: `$1 || [[User:$2|$2]] ` SET @row_num = 0; SET @row_num2 = 0; -- Note! 2nd @row_num seem to be required for MariaDb 10.1 when sorting by 2 columns. SELECT (@row_num2:= @row_num2 + 1) as number, actor_name, review_count, IFNULL(review_count_i, 0) FROM -- next reviews ( SELECT (@row_num:= @row_num + 1) as number_r_next, actor_name, review_count, log_actor FROM ( SELECT count(*) as review_count, log_actor FROM logging WHERE log_type = 'review' AND log_action = 'approve' AND log_timestamp >= 20190101000000 AND log_timestamp <= 20191231235959 GROUP BY log_actor ) r_next LEFT JOIN actor a ON actor_id = log_actor ORDER BY review_count DESC ) top_r_next -- add initial reviews LEFT JOIN ( SELECT count(*) as review_count_i, log_actor as log_actor_i FROM logging WHERE log_type = 'review' AND log_action = 'approve-i' AND log_timestamp >= 20190101000000 AND log_timestamp <= 20191231235959 GROUP BY log_actor ) r_initial ON log_actor_i = log_actor ORDER BY review_count DESC, review_count_i DESC
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...