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
MuRe
.
Toggle Highlighting
SQL
USE cawiki_p; SET @Year = '2010'; SELECT CONCAT(@Year,'01') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'0101000000' AND CONCAT(@Year,'0131000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'02') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'0201000000' AND CONCAT(@Year,'0228000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'03') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'0301000000' AND CONCAT(@Year,'0331000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'04') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'0401000000' AND CONCAT(@Year,'0430000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'05') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'0501000000' AND CONCAT(@Year,'0531000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'06') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'0601000000' AND CONCAT(@Year,'0630000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'07') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'0701000000' AND CONCAT(@Year,'0731000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'08') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'0801000000' AND CONCAT(@Year,'0831000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'09') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'0901000000' AND CONCAT(@Year,'0930000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'10') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'1001000000' AND CONCAT(@Year,'1031000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'11') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'1101000000' AND CONCAT(@Year,'1131000000') AND page_namespace = 0 UNION ALL SELECT CONCAT(@Year,'12') as Month, COUNT( distinct user_name) as User_Count FROM cawiki_p.revision rev INNER JOIN user ON user_id = rev.rev_actor LEFT OUTER JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page ON rev.rev_page = page_id WHERE rev.rev_timestamp BETWEEN CONCAT(@Year,'1201000000' AND CONCAT(@Year,'1231000000') AND page_namespace = 0 ;
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...