Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Wikidata - wb_terms - sample data (items with ar labels)
by
Mr. Ibrahem
This query is marked as a draft
This query has been published
by
Mr. Ibrahem
.
6
Toggle Highlighting
SQL
/*use wikidatawiki_p; SELECT term_entity_id , term_text from wb_terms join wb_items_per_site on term_entity_id = ips_item_id WHERE term_entity_type = 'item' AND term_language = 'ar' AND term_type = 'label' and term_entity_id not in (SELECT ips_item_id FROM wb_items_per_site WHERE ips_item_id = term_entity_id and ips_site_id = "arwiki" ) and term_entity_id in (SELECT pl_from from pagelinks where pl_from = term_entity_id and pl_title ='Q5' ) #and term_entity_id in (select pl_from from wikidatawiki_p.pagelinks where pl_from = term_entity_id AND (pl_title = 'P21')) and term_entity_id in (SELECT pl_from FROM pagelinks WHERE pl_title = 'P21' AND pl_namespace = 120) group by ips_item_id limit 10;*/ USE wikidatawiki_p; SELECT * #CONCAT('Q', term_entity_id, '') AS id, term_text from wb_terms , pagelinks, wb_items_per_site /* LEFT JOIN wb_items_per_site ON term_entity_id = ips_item_id AND ips_site_id = 'arwiki' JOIN pagelinks ON pl_from = term_entity_id AND pl_namespace = 120 AND pl_title = 'P21' LEFT JOIN pagelinks ON pl_from = term_entity_id AND pl_namespace = 0 AND pl_title = 'Q5' */ WHERE term_entity_type = 'item' and pl_from = term_entity_id AND ips_site_id = 'arwiki' #AND ips_site_page IS NULL AND term_language = 'ar' AND term_type = 'label' ORDER BY term_entity_id group BY term_entity_id limit 10;
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...