title: Using tuples in SQL "IN" clause
body: <p>I have a table containing the fields group_id and group_type and I want to query the table for all the records having any tuple (<em>group id</em>, <em>group type</em>) from a list of tuples. For example, I want to be able to do something like:</p>
  
  <pre><code>SELECT *
  FROM mytable
  WHERE (group_id, group_type) IN (("1234-567", 2), ("4321-765", 3), ("1111-222", 5))
  </code></pre>
  
  <p>A very similar question is already asked at: <a href="https://stackoverflow.com/questions/1474964/using-tuples-in-sql-in-clause">using tuples in sql in clause</a> , but the solution proposed there presumes the tuple list is to be fetched from another table. This doesn't work in my case is the tuple values are hard coded.</p>
  
  <p>One solution is to use string concatenation:</p>
  
  <pre><code>SELECT *
  FROM mytable
  WHERE group_id + STR(group_type, 1) IN ("1234-5672", "4321-7653", "1111-2225")
  </code></pre>
  
  <p>But the problem is that the table is quite big and doing a string concatenation and conversion for each record would be very expensive.</p>
  
  <p>Any suggestion?</p>