title: SQL: filter on a combination of two column values
body: <p>I have a table <code>balances</code> with the following columns:</p>
  
  <pre><code>bank | account | date | amount
  </code></pre>
  
  <p>I also have a table <code>accounts</code> that has <code>bank</code> and <code>account</code> as its composite primary key.</p>
  
  <p>I want to do a query like the following pseudocode:</p>
  
  <pre><code>select date, sum(amount) as amount from balances where 
  bank and account in (list of bank and account pairs) group by date
  </code></pre>
  
  <p>The list of bank-account pairs is supplied by the client. 
  How do I do this? Create a temp table and join on it?</p>
  
  <p>I'm using Sybase</p>