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
XXN
.
see also query/11102
Toggle Highlighting
SQL
use cebwiki_p; SELECT p1.page_title, COUNT(pl1.pl_title) as number_of_links1, p2.page_title, COUNT(pl2.pl_title) as number_of_links2 /*, CONCAT("[[", GROUP_CONCAT(pl_title ORDER BY pl_title ASC SEPARATOR "]], [["), "]]") as links*/ FROM /*page*/ (select * from page pg1 where pg1.page_namespace = 0 and pg1.page_is_redirect = 0 and pg1.page_title like "%(pagklaro_2)" ) as p1 JOIN pagelinks pl1 ON #p1.page_namespace = 0 and p1.page_is_redirect = 0 AND p1.page_id = pl1.pl_from and pl1.pl_from_namespace = 0 AND pl1.pl_namespace = 0 /* JOIN page_props ON page_id = page_props.pp_page AND page_props.pp_propname = "disambiguation"*/ JOIN /*page*/ (select * from page pg2 where pg2.page_namespace = 0 and pg2.page_is_redirect = 0 and pg2.page_title like "%(pagklaro)" ) as p2 on REPLACE(p1.page_title, '_(pagklaro_2)', '_(pagklaro)') = p2.page_title join pagelinks pl2 ON p2.page_id = pl2.pl_from join categorylinks on p1.page_id=cl_from and p2.page_id=cl_from WHERE cl_to = "Pagklaro_paghimo_ni_bot" and pl2.pl_from_namespace = 0 AND pl2.pl_namespace = 0 GROUP BY p1.page_id having COUNT(pl1.pl_title) < COUNT(pl2.pl_title) #ORDER BY number_of_links1 DESC, p1.page_title ASC
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...