My table:
Looking at your input and output, possibly you want
Select ppvnid from table where varid in (1,3,5) and prdid=9 and partnerid=1 group by partnerid, PrdId, ppvnid having count(distinct varid )=3
2.1m questions
2.1m answers
60 comments
56.6k users