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
Dalba
.
https://fa.wikipedia.org/w/index.php?title=%D8%A8%D8%AD%D8%AB_%D9%88%DB%8C%DA%A9%DB%8C%E2%80%8C%D9%BE%D8%AF%DB%8C%D8%A7:%D9%88%DB%8C%DA%A9%DB%8C%E2%80%8C%D9%BE%D8%B1%D9%88%DA%98%D9%87_%D8%AA%D9%82%D8%B3%DB%8C%D9%85%D8%A7%D8%AA_%DA%A9%D8%B4%D9%88%D8%B1%DB%8C_%D8%A7%DB%8C%D8%B1%D8%A7%D9%86/%D9%81%D8%A7%D8%B2_%D8%AF%D9%88%D9%85&oldid=18799038#.D8.B2.DB.8C.D8.B1.D9.BE.D8.B1.D9.88.DA.98.D9.87_.D9.87.D9.81.D8.AA.D9.85:_.D8.AD.D8.B0.D9.81.2F.D8.A7.D8.B5.D9.84.D8.A7.D8.AD_.D9.BE.DB.8C.D9.88.D9.86.D8.AF.D9.87.D8.A7.DB.8C_.D9.82.D8.B1.D9.85.D8.B2
Toggle Highlighting
SQL
/* get most used red links referred to from village articles */ USE fawiki_p; /* pl_title represents the title of red links inside village articles */ /* page_id is the referrer */ SELECT pl_title, count(pl_title) /* join the referrer to each pl_title */ FROM pagelinks LEFT JOIN page ON pl_from = page_id WHERE pl_namespace = 0 AND page_namespace = 0 /* pl_title is a red link */ AND NOT EXISTS ( SELECT NULL FROM page WHERE page_namespace = 0 AND page_title = pl_title ) /* the referrer is a village article */ AND EXISTS ( SELECT cl_from FROM categorylinks WHERE cl_from = page_id AND cl_to LIKE "روستاهای_%" ) GROUP BY pl_title ORDER BY count(pl_title) DESC; Don't Run
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...