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
MarioGom
.
Toggle Highlighting
SQL
SELECT cl_from, page_title, min_timestamp, max_timestamp, n_this_month, n_revs / TIMESTAMPDIFF(MONTH, min_timestamp, max_timestamp) AS avg_per_month, n_this_month / ((n_revs - n_this_month) / (TIMESTAMPDIFF(MONTH, min_timestamp, max_timestamp) - 1)) AS ratio FROM ( SELECT cl_from, COUNT(*) AS n_revs, MIN(rev_timestamp) AS min_timestamp, MAX(rev_timestamp) AS max_timestamp, SUM(CASE WHEN rev_timestamp >= DATE_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 MONTH) THEN 1 ELSE 0 END) AS n_this_month FROM categorylinks INNER JOIN revision ON revision.rev_page = categorylinks.cl_from WHERE TRUE AND cl_to LIKE '%\_companies\_established\_in\_%' AND cl_type = 'page' GROUP BY cl_from ) AS q INNER JOIN page ON page.page_id = q.cl_from WHERE TRUE AND n_this_month > 2 AND TIMESTAMPDIFF(MONTH, min_timestamp, max_timestamp) > 1 AND n_this_month / ((n_revs - n_this_month) / (TIMESTAMPDIFF(MONTH, min_timestamp, max_timestamp) - 1)) > 1 ORDER BY ratio DESC
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...