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
Herzi Pinki
.
Find objects with same id and more than x occurrences, but missing common category with same id
Toggle Highlighting
SQL
use commonswiki_p; #describe category; set @cat := 'Cultural_heritage_monuments_in_Austria_with_known_IDs'; #describe page; #describe image; #describe user; #select * from category where cat_title = @cat limit 100; ## all subcats as page_ids #select page_title from page where page_id in (select cat_id from category where cat_title = @cat); #select page_id from page where page_title = @cat; #select page_title from page where page_id in (select cl_from from categorylinks where cl_type = 'subcat' and cl_to = @cat); #select page_title from page #where page_id in ( #select page_id, page_title from page where page_title = @cat and page_namespace=14 #union all #select cl_from as id from categorylinks where cl_type = 'subcat' and cl_to = @cat # ); #gt_lat, gt_lon, gt_page_id, gt_name, (select page_title from page where page_id = gt_page_id),gt_country,gt_region from geo_tags #where gt_lat='0' AND gt_lon='0'; # select page_id, page_title from page inner join categorylinks on page.page_id = categorylinks.cl_from where page_title = @cat and page_namespace=14 SELECT cl_sortkey_prefix as id, (select page_title from page where page_id = cl_from) as title, max(cl_type) as type, count(*) as count from categorylinks WHERE (cl_to = @cat and count>3 and type='file') #and cl_sortkey_prefix='' group by id order by id, type asc # internal key seems not to match collation of values LIMIT 200 ;
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...