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 CONCAT('Q',epp_entity_id), GROUP_CONCAT(DISTINCT labels.term_text ORDER BY labels.term_text ASC SEPARATOR ', ') AS labels, GROUP_CONCAT(DISTINCT aliases.term_text ORDER BY aliases.term_text ASC SEPARATOR ', ') AS aliases FROM (SELECT * FROM wb_terms WHERE term_type = 'label' AND term_entity_type = 'item') AS labels JOIN wb_entity_per_page ON epp_entity_id = labels.term_entity_id JOIN pagelinks AS links1 ON links1.pl_from = epp_page_id AND links1.pl_title IN ('Q202444','Q12308941','Q11879590','Q3409032') AND links1.pl_from_namespace = 0 LEFT JOIN pagelinks AS links2 ON links2.pl_from = epp_page_id AND links2.pl_title = 'Q13406463' LEFT JOIN wb_terms AS aliases ON aliases.term_entity_id = epp_entity_id WHERE labels.term_language IN ('en','cs','da','de','eo','es','et','fi','fr','hr','hu','is','it','nb','nl','nn','pl','pt','sl','sk','sv','tr','vi') AND aliases.term_type = 'alias' AND aliases.term_entity_type = 'item' AND aliases.term_language IN ('en','cs','da','de','eo','es','et','fi','fr','hr','hu','is','it','nb','nl','nn','pl','pt','sl','sk','sv','tr','vi') AND links2.pl_title IS NULL AND NOT epp_entity_id IN (5, 49614, 82799, 95074, 202444, 215627, 624240, 1043932, 1376038, 1417657, 2916264, 3342937, 3409027, 3409032, 4960829, 6581072, 6581097, 8167791, 8610768, 11879590, 12308941) GROUP BY epp_page_id HAVING COUNT(DISTINCT labels.term_text) > 1 ORDER BY epp_page_id;
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...