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
Saeidpourbabak
.
Toggle Highlighting
SQL
SELECT DISTINCT concat('# [[:en:template:',REPLACE(tmpl.page_title,'_',' '),']]') template, pl_title en_article, ll_title fa_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 = "fa" AND REPLACE(ll_title,' ','_') IN ( SELECT p1.page_title FROM fawiki_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 fawiki_p.page_props WHERE pp_propname = 'disambiguation' ) # not receiving direct link AND NOT ( p1.page_title IN ( SELECT pl1.pl_title FROM fawiki_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 fawiki_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 fawiki_p.redirect JOIN fawiki_p.page AS p2 ON p2.page_id = rd_from JOIN fawiki_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 ) ) ) ) LIMIT 10;
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...