title: WHERE col1,col2 IN (...) [SQL subquery using composite primary key]
body: <p>Given a table <code>foo</code> with a composite primary key <code>(a,b)</code>, is there a legal syntax for writing a query such as:</p>
  
  <pre><code>SELECT ... FROM foo WHERE a,b IN (SELECT ...many tuples of a/b values...);
  UPDATE foo SET ... WHERE a,b IN (SELECT ...many tuples of a/b values...);
  </code></pre>
  
  <p>If this is not possible, and you could not modify the schema, how could you perform the equivalent of the above?</p>
  
  <p><em>I'm also going to put the terms "compound primary key", "subselect", "sub-select", and "sub-query" here for search hits on these aliases.</em></p>
  
  <p><strong>Edit</strong>: I'm interested in answers for standard SQL as well as those that would work with PostgreSQL and SQLite 3.</p>