Test query b
| Name | Region | categories |
|---|---|---|
| Afghanistan | Asia | Test cat a |
| Aland Islands | Europe | Test cat a |
| American Samoa | Oceania | Test cat b |
| British Indian Ocean Territory | Africa | |
| Eritrea | Africa | |
| French Southern Territories | Africa | |
| Haiti | Americas | |
| Italy | Europe | |
| Kuwait | Asia | |
| Lithuania | Europe | |
| Mauritania | Africa | |
| Mauritius | Africa | |
| Palestinian Territory Occupied | Asia | |
| Pitcairn Island | Oceania | |
| Saint Kitts And Nevis | Americas | |
| Switzerland | Europe | |
| United Arab Emirates | Asia | |
| United Kingdom | Europe | |
| United States | Americas | |
| United States Minor Outlying Islands | Americas | |
| Vatican City State (Holy See) | Europe | |
| Virgin Islands (British) | Americas |
SELECT t0.page_id AS `page_id`,t0.value AS `v0`,t1.value AS `v1`,GROUP_CONCAT(categorylinks_t0.cl_to SEPARATOR 0x1E) AS `categories` FROM (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE p.schema_id = '3' AND p.path_no_index = 'name' ) `t0` LEFT JOIN (SELECT t.value,t.page_id,p.path_no_index,p.path,p.path_parent,p.schema_id FROM `visualdata_text` `t` JOIN `visualdata_props` `p` ON ((p.id=t.prop_id)) WHERE p.schema_id = '3' AND p.path_no_index = 'region' ) `t1` ON (((t1.page_id=t0.page_id) AND (t1.path_parent = t0.path_parent))) LEFT JOIN `categorylinks` `categorylinks_1` ON (((categorylinks_1.cl_from = t0.page_id) AND ((CONVERT(categorylinks_1.cl_to USING utf8mb4) COLLATE utf8mb4_general_ci LIKE '%it%' ESCAPE '`')))) JOIN `page` `page_alias` ON ((page_alias.page_id = t0.page_id)) LEFT JOIN `categorylinks` `categorylinks_t0` ON ((t0.page_id = categorylinks_t0.cl_from)) WHERE ((t0.value IS NOT NULL)) AND ((t0.value LIKE '%it%' ESCAPE '`') OR (t1.value LIKE '%it%' ESCAPE '`') OR (t0.page_id = categorylinks_1.cl_from)) GROUP BY t0.page_id, t0.value, t1.value LIMIT 100