SQL
x
USE trwiki_p;
SELECT concat("tr.wikipedia.org/wiki?curid=",page_id) as url, replace(page_title,"_"," ") as ad, count(*)
, IF(page_id in (SELECT tl2.tl_from FROM templatelinks tl2 where tl2.tl_title like "•w"), 1, 0) as inn
from templatelinks tl join page on page_title = tl.tl_title
where tl.tl_from in (SELECT tl2.tl_from FROM templatelinks tl2 where tl2.tl_title like "•wrap"
-- and tl_from_namespace = 10
)
and page_namespace = 10
group by 1 having count(*) > 1
order by inn desc, count(*) desc
;
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.