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

SQL

x
 
use bnwikisource_p;
SET @n = 1; /* edits threshold */
SET @u = 30; /* activity unit in days */
SET @T = "20170101"; /* to replace with dynamic value */
SELECT
    user, revisions
FROM (
    /* Get revisions to content pages that are still visible */
    SELECT
        rev_user_text as user,
        SUM(rev_id IS NOT NULL) AS revisions
    FROM
        revision
      join page
      on page_id = rev_page
    WHERE
        rev_user != 0
    AND
        rev_timestamp BETWEEN DATE_FORMAT(DATE_SUB(@T, INTERVAL @u DAY), "%Y%m%d%H%i%S") AND @T
    and
    page_namespace = 0
    GROUP BY user
    ) AS user_content_revision_count
GROUP BY
    user
HAVING
    SUM(revisions) >= @n;
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...