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
Tarawneh
.
en templates containing articles with orphan arwiki interwiki
Toggle Highlighting
SQL
SELECT DISTINCT concat('# [[:en:template:',REPLACE(tmpl.page_title,'_',' '),']]') template, COUNT(tmpl.page_title) cnt #SELECT DISTINCT concat('# [[:en:template:',REPLACE(tmpl.page_title,'_',' '),']]') template, pl_title en_article, ll_title ar_article FROM enwiki_p.page AS tmpl JOIN enwiki_p.pagelinks ON pl_from=tmpl.page_id JOIN enwiki_p.page AS artl ON artl.page_title=pl_title JOIN enwiki_p.langlinks ON artl.page_id=ll_from WHERE tmpl.page_namespace = 10 AND tmpl.page_is_redirect = 0 AND artl.page_namespace = 0 AND artl.page_is_redirect = 0 AND pl_from_namespace = 10 AND tmpl.page_is_redirect = 0 AND pl_namespace = 0 AND ll_lang = "ar" AND tmpl.page_title LIKE "%Gmina%" AND tmpl.page_id NOT IN ( SELECT ll_from FROM langlinks WHERE ll_lang = 'ar' ) AND REPLACE(ll_title,' ','_') IN ( SELECT p1.page_title FROM arwiki_p.page AS p1 WHERE p1.page_is_redirect = 0 AND p1.page_namespace = 0 # not a DAB page AND p1.page_id NOT IN ( SELECT pp_page FROM arwiki_p.page_props WHERE pp_propname = 'disambiguation' ) # not receiving direct link AND NOT ( p1.page_title IN ( SELECT pl1.pl_title FROM arwiki_p.pagelinks AS pl1 WHERE pl1.pl_namespace = 0 AND pl1.pl_from_namespace = 0 AND pl1.pl_from NOT IN ( SELECT rd_from FROM arwiki_p.redirect WHERE rd_namespace = 0 AND rd_title = p1.page_title ) ) # not receiving redirect link OR ( p1.page_title IN ( SELECT rd_title FROM arwiki_p.redirect JOIN arwiki_p.page AS p2 ON p2.page_id = rd_from JOIN arwiki_p.pagelinks AS pl2 ON p2.page_title = pl2.pl_title WHERE rd_namespace = 0 AND p2.page_is_redirect = 1 AND p2.page_namespace = 0 AND pl2.pl_namespace = 0 AND pl2.pl_from_namespace = 0 ) ) ) ) AND ( tmpl.page_title NOT LIKE "Taxonomy%" AND tmpl.page_title NOT LIKE "%/doc%" AND tmpl.page_title NOT LIKE "POTD/%" ) GROUP BY tmpl.page_title HAVING COUNT(tmpl.page_title) > 1 ORDER BY COUNT(tmpl.page_title) DESC;
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...