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
Huji
.
Toggle Highlighting
SQL
use fawiki_p; SELECT rev_user_text, STR_TO_DATE(LEFT(min(rev_timestamp), 8), '%Y%m%d') AS sunrise, STR_TO_DATE(LEFT(min(sunset), 8), '%Y%m%d') AS sunset, old_edits, COUNT(rev_id) AS recent_edits, GROUP_CONCAT(DISTINCT(ug_group) SEPARATOR ' ') AS groups FROM revision JOIN ( SELECT rev_user old_user, max(rev_timestamp) sunset, COUNT(rev_id) AS old_edits FROM revision WHERE rev_user <> 0 AND rev_timestamp < CONCAT( YEAR(CURDATE()) - 3, LPAD(MONTH(CURDATE()) , 2, 0), '01000000' ) GROUP BY rev_user ) old ON old_user = rev_user LEFT JOIN user_groups ON rev_user = ug_user WHERE rev_user <> 0 AND rev_timestamp > CONCAT( YEAR(CURDATE()), LPAD(MONTH(CURDATE()) , 2, 0), '01000000' ) AND rev_user NOT IN ( SELECT rev_user FROM revision WHERE rev_user <> 0 AND rev_timestamp < CONCAT( YEAR(CURDATE()), LPAD(MONTH(CURDATE()) , 2, 0), '01000000') AND rev_timestamp > CONCAT( YEAR(CURDATE()) - 3, LPAD(MONTH(CURDATE()) , 2, 0), '01000000' ) ) GROUP BY rev_user_text
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...