Put your question in a Where clause
Thus:
Select d.ID, a.taxonomy, b.name, d.post_title, d.post_type
from wp_term_taxonomy a
inner join wp_terms b on a.term_id = b.term_id
inner join wp_term_relationships c on a.term_taxonomy_id = c.term_taxonomy_id
inner join wp_post d on c.object_id = d.id
where b.name = "Resina"
union
Select d.ID, a.taxonomy, b.name, d.post_title, d.post_type
from wp_term_taxonomy a
inner join wp_terms b on a.term_id = b.term_id
inner join wp_term_relationships c on a.term_taxonomy_id = c.term_taxonomy_id
inner join wp_post d on c.object_id = d.id
where b.name = "featured"
name = 'Resina' AND name = 'featured'
basically you already have the solution, put this in awhere
in your query– Ricardo Pontual
if I do it does not return me result
– Rívero Felipe
And it’s right he returns nothing
– DbaAlone
he can’t have both names at the same time
– DbaAlone
therefore the use of Union is necessary
– DbaAlone
I need you to list only if the two exist otherwise I don’t want you to list
– Rívero Felipe