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 pagelinks pl1 JOIN page p1 ON p1.page_namespace = 0 AND p1.page_id = pl1.pl_from and p1.page_title like "%(pagklaro_2)" /* JOIN page_props ON page_id = page_props.pp_page AND page_props.pp_propname = "disambiguation"*/ JOIN page p2 on REPLACE(p1.page_title, '_(pagklaro_2)', '_(pagklaro)') = p2.page_title join pagelinks pl2 ON p2.page_namespace = 0 AND p2.page_id = pl2.pl_from WHERE pl1.pl_from_namespace = 0 AND pl1.pl_namespace = 0 and p1.page_is_redirect = 0 and pl2.pl_from_namespace = 0 AND pl2.pl_namespace = 0 and p2.page_is_redirect = 0 having COUNT(pl1.pl_title) < COUNT(pl2.pl_title) GROUP BY p1.page_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...