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

SQL

AخA
 
USE zhwiki_p;
SELECT COUNT(DISTINCT user_id) FROM user
#JOIN revision ON rev_user == user_id
WHERE
# 注册满七天,且 ..
(user_registration IS NULL OR user_registration <= DATE_SUB(NOW(), INTERVAL 7 DAY)) AND (
# 解任投票联署提出或上任投票开始1个月前,编辑100次或以上 ....
  (SELECT COUNT(*) FROM revision WHERE rev_user == user_id AND
   rev_timestamp <= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 MONTH), '%Y%m%d%H%i%s')) >= 100 AND
# .... 并在联署提出或上任投票开始前3个月内至少有一次编辑(不包括任何用户页及用户对话页)
  (SELECT COUNT(*) FROM revision JOIN page ON rev_page == page_id
   WHERE rev_user == user_id AND page_namespace != 2 AND page_namespace != 3 AND
   rev_timestamp <= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 3 MONTH), '%Y%m%d%H%i%s')) >= 1
# .. 或 ..
OR
# 编辑3000次或以上 ....
  (SELECT COUNT(*) FROM revision WHERE rev_user == user_id) >= 3000 OR
# .... 或编辑1500次条目或以上
  (SELECT COUNT(*) FROM revision JOIN page ON rev_page == page_id
   WHERE rev_user == user_id AND page_namespace == 0) >= 1500
)
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...