title: SQL multiple columns in IN clause
body: <p>If we need to query a table based on some set of values for a given column, we can simply use the IN clause. </p>
  
  <p>But if query need to be performed based on multiple columns, we could not use IN clause(grepped in SO threads.) </p>
  
  <p>From other SO threads, we can circumvent this problem using joins or exists clause etc. But they all work if both main table and search data are in the database. </p>
  
  <pre><code>E.g
  User table:
  firstName, lastName, City
  </code></pre>
  
  <p>Given a list of (firstname, lastName) tuples, I need to get the cities. </p>
  
  <p>I can think of following solutions. </p>
  
  <h1>1</h1>
  
  <p>Construct a select query like, </p>
  
  <pre><code>SELECT city from user where (firstName=x and lastName=y) or (firstName=a and lastName=b) or .....
  </code></pre>
  
  <h1>2</h1>
  
  <p>Upload all firstName, lastName values into a staging table and perform a join between 'user' table and the new staging table. </p>
  
  <p>Are there any options for solving this problem and what is the preferred of solving this problem in general?</p>