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
Matěj Suchánek
.
Toggle Highlighting
SQL
USE wikidatawiki_p; SELECT page1.page_title, GROUP_CONCAT(terms1.term_text), links1.pl_title#, links3.pl_title, page2.page_title, GROUP_CONCAT(terms2.term_text) FROM page AS page1 JOIN pagelinks AS links1 ON links1.pl_from = page1.page_id AND links1.pl_title IN ("Q202444","Q12308941","Q11879590") AND links1.pl_from_namespace = 0 AND links1.pl_namespace = 0 LEFT JOIN pagelinks AS links3 ON links3.pl_from = page1.page_id AND links3.pl_title = "P1533" -- AND links3.pl_namespace = 120 JOIN wb_terms AS terms1 ON CONCAT("Q",terms1.term_entity_id) = page1.page_title AND terms1.term_language = "cs" # CROSS JOIN wb_terms AS terms2 # ON terms2.term_text = terms1.term_text # JOIN page AS page2 # ON page2.page_title = CONCAT("Q",terms2.term_entity_id) # JOIN pagelinks AS links2 # ON links2.pl_title = "Q101352" AND links2.pl_namespace = 0 AND links2.pl_from_namespace = 0 WHERE links3.pl_from IS NULL # WHERE terms1.term_text = terms2.term_text AND links3.pl_from IS NULL GROUP BY page1.page_title # HAVING (COUNT(DISTINCT terms1.term_text) = 1 AND COUNT(DISTINCT terms2.term_text) = 1) 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...