I am trying to extract multiple IDs from wp_postmeta table, with double WHERE condition to be checked in two records:
WHERE (meta_key = 'leather' AND meta_value = 'calf') -> First record
AND
WHERE (meta_key = 'gender' AND meta_value = 'woman') -> Second record
In a shop selling leather goods I need to extract products (based on postmeta) in CALF (leather) for WOMAN (gender).
The condition must be checked on two records with the same ID, as shown in the picture.
I have tried about a dozen different solutions from various posts but with no result until now.
Thank you.
View example in wp_postmeta table:

You probably need an inner join for that:
I had a similar problem, but in my case both `meta_value` needed to be the same (`1`)
I solved it this way:
you probably need a
group bystatement as well