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; set @year = year(curdate()); set @month = month(curdate()); set @gapyears = 2; 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 from revision join ( select rev_user, max(rev_timestamp) sunset from revision where rev_user <> 0 and rev_timestamp < concat(@year - @gapyears, LPAD(@month, 2, 0), '01000000') group by rev_user ) old on old.rev_user = revision.rev_user where rev_user <> 0 and rev_timestamp > concat(@year, LPAD(@month, 2, 0), '01000000') and rev_user not in ( select rev_user from revision where rev_user <> 0 and rev_timestamp < concat(@year, LPAD(@month, 2, 0), '01000000') and rev_timestamp > concat(@year - @gapyears, LPAD(@month, 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...