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
HenriqueCrang
.
Toggle Highlighting
SQL
SELECT user_id, user_name, user_registration, SUM(early_main_edits) AS early_main_edits, SUM(surviving_edits) AS surviving_edits FROM ( (SELECT user_id, user_name, user_registration, SUM(DATEDIFF(rev_timestamp, user_registration) < 30 AND page_namespace = 0) AS early_main_edits, SUM(DATEDIFF(rev_timestamp, user_registration) BETWEEN 60 AND 180) AS surviving_edits FROM user LEFT JOIN revision ON user_id = rev_user INNER JOIN page ON rev_page = page_id WHERE rev_timestamp <= DATE_FORMAT( DATE_ADD(user_registration, INTERVAL 180 DAY), "%Y%m%d%H%i%s") GROUP BY user_id, user_name, user_registration) UNION (SELECT user_id, user_name, user_registration, SUM(DATEDIFF(ar_timestamp, user_registration) < 30 AND ar_namespace = 0) AS early_main_edits, SUM(DATEDIFF(ar_timestamp, user_registration) BETWEEN 60 AND 180) AS surviving_edits FROM archive INNER JOIN user ON ar_user = user_id WHERE ar_timestamp <= DATE_FORMAT( DATE_ADD(user_registration, INTERVAL 180 DAY), "%Y%m%d%H%i%s") GROUP BY user_id, user_name, user_registration) ) user_edit_counts GROUP BY 1,2,3;
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...