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
HakanIST
.
Toggle Highlighting
SQL
USE trwiki_p; SELECT CONCAT(month, '-', year) AS monthly, SUM(period < 7) AS less_than_1_week, SUM(period BETWEEN 7 AND 30) AS 1_week_to_1_month, SUM(period BETWEEN 31 AND 365) AS 1_month_to_1year, SUM(period > 365) AS more_than_1_year FROM ( SELECT SUBSTR(first, 5, 2) AS month, SUBSTR(first, 1, 4) AS year, TIMESTAMPDIFF(DAY, first, last) AS period FROM ( SELECT rev_user,MIN(rev_timestamp) AS first, MAX(rev_timestamp) AS last FROM revision_userindex WHERE rev_user != 0 AND rev_user NOT IN (SELECT ug_user FROM user_groups WHERE ug_group = 'bot') GROUP BY rev_user ) a ) b GROUP BY monthly ORDER BY year, month;
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...