Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Wikidata terms with trailing spaces
by
Matěj Suchánek
This query is marked as a draft
This query has been published
by
Matěj Suchánek
.
Toggle Highlighting
SQL
USE cswiki_p; SELECT CONCAT('Kategorie:',cl_to), ids1.pp_value AS item1, pages.page_title, ids2.pp_value AS item2, 'P301' , 'S143', 'Q191168' FROM page AS pages JOIN categorylinks AS cl ON cl_from = pages.page_id JOIN page AS categories ON categories.page_namespace = 14 AND categories.page_title = cl_to JOIN (SELECT * FROM page_props WHERE pp_propname = 'wikibase_item') AS ids1 ON ids1.pp_page = categories.page_id JOIN wikidatawiki_p.page AS items ON items.page_namespace = 0 AND items.page_title = ids1.pp_value LEFT JOIN wikidatawiki_p.pagelinks AS withmain ON withmain.pl_from = items.page_id AND pl_title = 'P301' AND pl_namespace = 120 JOIN (SELECT * FROM page_props WHERE pp_propname = 'wikibase_item') AS ids2 ON ids2.pp_page = pages.page_id WHERE cl_sortkey_prefix = ' ' AND withmain.pl_from IS NULL AND pages.page_title NOT LIKE 'Seznam%' ORDER BY cl_to;
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...