This query is marked as a draft This query has been published by Vahurzpu.

SQL

AخA
 
use commonswiki_p;
SELECT page.page_title
FROM page
WHERE page.page_namespace = 14
AND page.page_title LIKE 'Paintings_by_%'
AND page.page_title NOT LIKE '%in_the%'
AND page.page_title NOT LIKE '%useum%'
AND page.page_is_redirect = 0
AND page.page_id NOT IN (SELECT cl_from FROM categorylinks WHERE cl_to = "Paintings_by_artist")
AND page.page_id NOT IN (
  SELECT innercat.cl_from
  FROM categorylinks outercat
  INNER JOIN page catpage ON catpage.page_id = outercat.cl_from
  INNER JOIN categorylinks innercat ON innercat.cl_to = catpage.page_title
  WHERE outercat.cl_to = "Paintings_by_artist_by_country_of_origin"
  AND catpage.page_namespace = 14
)
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.

Checking query status...