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

SQL

x
 
use zhwiki_p;
SET @VOTE_TIME = '20241001000000';
SET @PRIOR_90_VOTE_TIME =
        DATE_FORMAT(DATE_SUB(STR_TO_DATE(@VOTE_TIME, '%Y%m%d%H%i%s'), INTERVAL 90 DAY), '%Y%m%d%H%i%s');
SET @PRIOR_120_VOTE_TIME =
        DATE_FORMAT(DATE_SUB(STR_TO_DATE(@VOTE_TIME, '%Y%m%d%H%i%s'), INTERVAL 120 DAY), '%Y%m%d%H%i%s');
EXPLAIN
SELECT part1.actor_name AS user_name
FROM (SELECT actor_user, actor_name, COUNT(*) AS edits
      FROM actor
               JOIN user ON actor_user = user.user_id
               JOIN all_revision ON actor_id = all_revision.rev_actor
      WHERE actor_user IS NOT NULL
        AND (user.user_registration < @PRIOR_120_VOTE_TIME
          OR user.user_registration IS NULL)
        AND all_revision.rev_timestamp < @VOTE_TIME
      GROUP BY actor_id
      HAVING edits >= 3000) AS part1
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...