SQL
AخA
SELECT CONCAT(LEFT(rev_timestamp, 4), '-', SUBSTR(rev_timestamp, 5, 2)) AS 'yyyy-mm',
COUNT(mobile) AS 'mobile edits',
COUNT(*) - COUNT(mobile) AS 'nonmobile edits',
COUNT(*) AS 'total edits',
100 * COUNT(mobile) / COUNT(*) AS 'percent mobile'
FROM (SELECT DISTINCT rev_id,
rev_timestamp,
CASE WHEN ct_id IS NOT NULL THEN 1 ELSE NULL END AS mobile
FROM revision_userindex
JOIN actor_revision ON actor_id = rev_actor
LEFT JOIN change_tag ON ct_rev_id = rev_id
AND ct_tag_id IN (SELECT ctd_id
FROM change_tag_def
WHERE ctd_name LIKE '%mobile%')
WHERE actor_name = 'Lee Vilenski') sq
GROUP BY LEFT(rev_timestamp, 6);
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.