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