title: SQL filtering by multiple columns
body: <p>I have a MySql table, which I want to query for rows in which <strong>pairs</strong> of columns are in a specific set.
  For example, say my table looks like this:</p>
  
  <pre><code>id | f1  | f2
  -------------    
  1  | 'a' | 20
  2  | 'b' | 20
  3  | 'a' | 30
  4  | 'b' | 20
  5  | 'c' | 20
  </code></pre>
  
  <p>Now, I wish to extract rows in which the pair <strong>(f1, f2)</strong> are either ('a',30) or ('b', 20), namely rows 2,3,4. I also wish to do it using an 'IN' style filter, as I may have many pairs to fetch. If I try something like:</p>
  
  <p><code>
  SELECT * FROM my_table WHERE f1 IN ('a','b') AND f2 IN (30, 20)
  </code></p>
  
  <p>I get the Cartesian product of the values specified for f1 and f2 in the IN clauses, i.e. the rows with all possible combinations for f1 = 'a' or 'b', and f2 = 30, 20, hence row 1 is also selected.</p>
  
  <p>In short, I'm need something like:</p>
  
  <p><code>
  SELECT * FROM my_table WHERE (f1,f2) IN (('a',30), ('b',20))
  </code></p>
  
  <p>only with a valid SQL syntax :-)</p>
  
  <p>Any ideas?</p>