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
Certes
.
Toggle Highlighting
SQL
SELECT P1.page_title AS article, CONCAT(CL1.cl_to) AS categories FROM page P1 JOIN categorylinks CL1 ON CL1.cl_from=P1.page_id AND CL1.cl_to="Fruit_trees" WHERE P1.page_namespace=0 AND P1.page_title="Apple" UNION SELECT P1.page_title AS article, CONCAT(CL1.cl_to, ", ", CL2.cl_to) AS categories FROM page P1 JOIN categorylinks CL1 ON CL1.cl_from=P1.page_id JOIN page P2 ON P2.page_title = CL1.cl_to AND P2.page_namespace=14 JOIN categorylinks CL2 ON CL2.cl_from=P2.page_id AND CL2.cl_to="Fruit_trees" WHERE P1.page_namespace=0 AND P1.page_title="Apple" UNION SELECT P1.page_title AS article, CONCAT(CL1.cl_to, ", ", CL2.cl_to, ", ", CL3.cl_to) AS categories FROM page P1 JOIN categorylinks CL1 ON CL1.cl_from=P1.page_id JOIN page P2 ON P2.page_title = CL1.cl_to AND P2.page_namespace=14 JOIN categorylinks CL2 ON CL2.cl_from=P2.page_id JOIN page P3 ON P3.page_title = CL2.cl_to AND P3.page_namespace=14 JOIN categorylinks CL3 ON CL3.cl_from=P3.page_id AND CL3.cl_to="Fruit_trees" WHERE P1.page_namespace=0 AND P1.page_title="Apple"
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...