I have to display some posts utilizing a custom choose query. This practice choose query needs to obtain the posts in 2 taxonomies.

Look the query:

FROM $wpdb->posts
LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID =
LEFT JOIN $wpdb->term_taxonomy
ON($wpdb->term_relationships.term_taxonomy_id =
LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id =
$wpdb->posts.post_type = 'post'
AND $wpdb->posts.post_status = 'publish'
AND $wpdb->term_taxonomy.taxonomy = 'continentes'
AND $wpdb->terms.slug = 'asia'
AND $wpdb->term_taxonomy.taxonomy = 'pais'
AND $wpdb->terms.slug = 'china'
ORDER BY $wpdb->posts.post_date DESC

If your only use one condition the query is effective, enjoy it:

... AND $wpdb->term_taxonomy.taxonomy = 'continentes' AND $wpdb->terms.slug = 'asia' ...

However I require the posts in taxonomy "continentes" and "pais".


($wpdb->term_taxonomy.taxonomy = 'continentes' 
$wpdb->term_taxonomy.taxonomy = 'pais')

If Wordpress supports it you should use IN:

AND $wpdb->term_taxonomy.taxonomy in ('continentes', 'pais')

Presuming each publish has only 1 taxonomy, your query will not return any improvements, like a publish can not be both in continents and pais. you have to improve your where clause to appear such as this:

AND ($wpdb->term_taxonomy.taxonomy = 'continentes' OR $wpdb->term_taxonomy.taxonomy = 'pais')