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
Ahmad252
.
This query is intended to be used for tests.
Toggle Highlighting
SQL
use commonswiki_p; select count(cl_from) as Counter, concat("{{/Template|",cl_sortkey_prefix, "}}") as ID, concat("[[:File:", page_title, "]]") as Name, (select distinct cl_sortkey_prefix from categorylinks join page on page_id = cl_from where cl_to = "Cultural_heritage_monuments_in_Iran_with_known_IDs" and cl_type = "subcat" ) as BLA from categorylinks join page on page_id = cl_from where cl_to = "Cultural_heritage_monuments_in_Iran_with_known_IDs" and cl_type = "file" and cl_sortkey_prefix not in (select distinct cl_sortkey_prefix from categorylinks join page on page_id = cl_from where cl_to = "Cultural_heritage_monuments_in_Iran_with_known_IDs" and cl_type = "subcat" ) group by cl_sortkey_prefix order by Counter desc limit 100;
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...