title: Match Multiple rows of same columns in Table - MySql
body: <p>I have a table as follows.</p>
  
  <pre><code>+------------+-------------+---------+
  | productid  | attributeid | valueid |
  +------------+-------------+---------+
  | 1011052312 |      331100 | 1543697 |
  | 1011052312 |    33113319 | 1534108 |
  | 1011098009 |       33129 | 2655849 |
  | 1011052380 |      331100 | 1543697 |
  | 1011052380 |    33113319 | 1233908 |
  +------------+-------------+---------+
  </code></pre>
  
  <p>Now I need to fetch only those <code>productid</code> who has very selected set of attribute value pair. Say for example I need to fetch a product who's attribute <code>331100</code> has value <code>1543697</code> and attribute <code>33113319</code> has value <code>1534108</code>. Product <code>1011052312</code> satisfy this condition.</p>
  
  <p>One thing to note is that I should avoid multiple joins because there can be a long list of attributes that I need to match. And for each attribute there can be any number of possible value.</p>