I have this result set
https://i.sstatic.net/7qb5g.jpg
and i'm trying to get entries as follow
get the ad_id of entries that have an attribute_id = 5 and value = 'Yamaha Mate V50' and attribute_id = 6 and value = 2012
i've tried stuff like
SELECT ad_id FROM value WHERE attribute_id = 5 && value = 'Yamaha Mate V50' && attribute_id = 6 && value = '2012'
this gives an empty result set
and if i did this
SELECT ad_id FROM value WHERE attribute_id = 5 && value = 'Yamaha Mate V50' || attribute_id = 6 && value = '2012'
i get ad_id = 1 and 3 which is good however i also get ad_id = 2 which is logical because it does have this condition (attribute_id = 6 && value = '2012')
so what should i do to select only the ad_ids that fulfill both conditions
(attribute_id = 5 && value = 'Yamaha Mate V50') "AND" (attribute_id = 6 && value = '2012')
Thanks in advance