-1
I need to return only the result that contains all the information that in the case of this image and the ID='8187'
Select d.ID, d.post_title, d.post_type,
MIN(CASE WHEN b.name = 'Resinas' THEN b.name END) AS categoria,
MIN(CASE WHEN b.name = 'featured' THEN b.name END) AS destaque
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_posts d on c.object_id = d.id
where b.name IN ('Resinas', 'featured') and d.post_type = 'product'
GROUP BY d.ID
group by d.id HAVING ( MIN( ...) IS NOT NULL AND MIN(....) IS NOT NULL ) would help if sql were text ...
– Motta