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
Rdrg109
.
The motivation for creating this query is that I wanted to know which users had contributed to Quechua Wikipedia in the last 6 months so that I could then invite them to the Telegram group used by the volunteers of that Wikipedia language edition.
Toggle Highlighting
SQL
# TODO: Count backwards 6 months # TODO: Regex for filtering out users which doesn't have names (i.e. IPv4 and IPv6) # TODO: Show year, month and day of the latest revision per user # TODO: Show number of revisions per user WITH my_revision AS ( SELECT rev_id, rev_actor, CONVERT(LEFT(rev_timestamp, 4), UNSIGNED INTEGER) AS year, CONVERT(SUBSTRING(rev_timestamp, 5, 2), UNSIGNED INTEGER) AS month FROM revision ), revisions_in_this_month AS ( SELECT rev_id, rev_actor FROM my_revision WHERE year = year(curdate()) AND month = month(curdate()) AND EXISTS ( SELECT actor_id FROM actor WHERE actor_id = rev_actor AND actor_name NOT REGEXP '^(?>(?>([A-F0-9]{1,4})(?>:(?1)){7}|(?!(?:.*[A-F0-9](?>:|$)){8,})((?1)(?>:(?1)){0,6})?::(?2)?)|(?>(?>(?1)(?>:(?1)){5}:|(?!(?:.*[A-F0-9]:){6,})(?3)?::(?>((?1)(?>:(?1)){0,4}):)?)?(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?>\.(?4)){3}))$' ) ) SELECT DISTINCT actor_name FROM revisions_in_this_month JOIN actor ON rev_actor = actor_id
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...