SQL
AخA
SET STATEMENT max_statement_time = 1000 FOR
SELECT CASE
WHEN Pt.page_title REGEXP "/[Aa]rchive" THEN "Archive"
WHEN Pt.page_title REGEXP "/[Ss]andbox" THEN "Sandbox"
WHEN Pt.page_title REGEXP "/talk_page_tutorial" THEN "Tutorial"
WHEN Pt.page_title REGEXP "/TWA(/.*)?$" THEN "TWA"
WHEN Pt.page_title REGEXP "/[12][901][0-9][0-9]/[0-9A-Z]" THEN "Monthly"
WHEN Pt.page_title REGEXP "[.][0-9]+/[0-9][0-9]$" THEN "IP range"
ELSE "{Other}" END AS Type,
COUNT(*) as "Count", MIN(Pt.page_title) AS "Example 1", MAX(Pt.page_title) AS "Example 2"
FROM page Pt
WHERE Pt.page_namespace=3 AND Pt.page_title LIKE "%/%"
AND NOT EXISTS (SELECT * FROM page Pu WHERE Pu.page_namespace=2 AND Pu.page_title = Pt.page_title)
GROUP BY Type ASC WITH ROLLUP
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.