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
DAlangi (WMF)
.
Harvest affiliate members for CA wiki.
Toggle Highlighting
SQL
# avoid duplicate user names SELECT DISTINCT cawikimedia_p.pagelinks.pl_title AS "Affiliated Username", p.page_title AS "Affiliate Groups" FROM cawikimedia_p.page AS p JOIN cawikimedia_p.pagelinks ON cawikimedia_p.pagelinks.pl_from = p.page_id # harvest from the a list of affiliates WHERE p.page_title IN ( "Membership" ) # exclude anything that ends with _(WMF) # as these are WMF staffs not aff members AND cawikimedia_p.pagelinks.pl_title NOT LIKE "%_(WMF)" # remove MediaWiki_message_delivery as it's # the mass message delivery default handle AND cawikimedia_p.pagelinks.pl_title NOT LIKE "%MediaWiki_message_delivery%" # focus on the User: namespace AND cawikimedia_p.pagelinks.pl_namespace = 2 # Unite both tables UNION # avoid duplicate user names SELECT DISTINCT cawikimedia_p.iwlinks.iwl_title AS "Affiliated Username", p.page_title AS "Affiliate Groups" FROM cawikimedia_p.page AS p JOIN cawikimedia_p.iwlinks ON cawikimedia_p.iwlinks.iwl_from = p.page_id # harvest from the a list of affiliates WHERE p.page_title IN ( "Membership" ) # also exclude interwiki links that are not user names AND cawikimedia_p.iwlinks.iwl_title NOT LIKE "User:%" # exclude anything that ends with _(WMF) # as these are WMF staffs not aff members AND cawikimedia_p.iwlinks.iwl_title NOT LIKE "%_(WMF)" # remove MediaWiki_message_delivery as it's # the mass message delivery default handle AND cawikimedia_p.iwlinks.iwl_title NOT LIKE "%MediaWiki_message_delivery%"
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...