It is necessary to select records according to several criteria, one of which is the belonging of the record to several headings, one of which is the parent 9 and the other children 10,11.
There is such a request:
$query_string1 = "select p.* from $wpdb->posts as p, $wpdb->postmeta as m1, $wpdb->term_relationships as m2, $wpdb->postmeta as m3 WHERE p.ID = m2.object_id and p.ID = m1.post_id and p.ID = m3.post_id and p.post_type='place' and m2.term_taxonomy_id in ('9,10,11') and m3.meta_value='38' and m3.meta_key='school' and (m1.meta_value LIKE \"%,$multi_city_id,%\") and m1.meta_key = 'post_city_id' and p.post_status='publish' order by p.post_title ASC"; The problem is that the query only works when the entry belongs to category 9, alone, or in combination with any other rubric. But if the record belongs exclusively to the child categories, the query does not select anything. What could be the reason?
'9,10,11'- Yura Ivanov