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 actor_name, 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, CASE WHEN ipb_user IS NULL THEN '' ELSE '{{بله}}' END AS blocked FROM revision JOIN actor ON rev_actor = actor_id JOIN ( SELECT actor_user old_user, max(rev_timestamp) sunset, COUNT(rev_id) AS old_edits FROM revision JOIN actor ON rev_actor = actor_id WHERE actor_user <> 0 AND rev_timestamp < CONCAT( YEAR(CURDATE()) - 3, LPAD(MONTH(CURDATE()) , 2, 0), '01000000' ) GROUP BY actor_user ) old ON old_user = actor_user LEFT JOIN user_groups ON actor_user = ug_user LEFT JOIN ipblocks ON actor_user = ipb_user WHERE actor_user <> 0 AND rev_timestamp > CONCAT( YEAR(CURDATE()), LPAD(MONTH(CURDATE()) , 2, 0), '01000000' ) AND actor_user NOT IN ( SELECT actor_user FROM revision JOIN actor ON rev_actor = actor_id WHERE actor_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 actor_name
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...