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
Valerio Bozzolan
.
Toggle Highlighting
SQL
use itwiki_p; SELECT CONCAT( 'File:', page_title ) as page_title, CONCAT( 'https://it.wikipedia.org/wiki/File:', page_title ) as url FROM page JOIN categorylinks AS cl ON ( page_id = cl.cl_from ) WHERE -- categories cl.cl_type = 'file' AND cl.cl_to IN ( 'Immagini_GFDL', 'Immagini_GFDL_con_disclaimer', 'Immagini_GFDL-Utente' ) -- without that template AND NOT EXISTS ( SELECT * FROM templatelinks WHERE page_id = tl_from AND tl_namespace = 10 AND tl_title = 'StemmiComunaliItaliani' ) -- exclude categories AND NOT EXISTS ( SELECT * FROM categorylinks AS sub_cl WHERE page_id = sub_cl.cl_from AND ( -- exclude other free licenses sub_cl.cl_to = 'Immagini_in_CC_BY-SA' OR sub_cl.cl_to LIKE 'Immagini_Creative_Commons_by-sa_%' OR sub_cl.cl_to LIKE 'Immagini_Creative_Commons_by_%' OR -- but also exclude files under a proprietary license (e.g. money) sub_cl.cl_to LIKE 'Immagini_protette_non_libere_-_%' OR sub_cl.cl_to = 'Immagini_stemmi_comunali_italiani' ) ) ORDER BY page_title
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...