SQL
AخA
USE commonswiki_p;
SELECT page_title
FROM categorylinks
JOIN page ON page_id=cl_from
LEFT JOIN imagelinks ON il_to=page_title
LEFT JOIN globalimagelinks ON gil_to=page_title
WHERE cl_type="file" AND page_namespace=6
AND cl_to IN ("Personal_images", "User page images")
AND gil_to IS NULL AND (il_to IS NULL or
il_from in (select page_id from page where page_title like "OgreBot/Uploads%" AND page_namespace=2))
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.