title: PostgreSQL SELECT the last order per customer per date range
body: <p>In PostgreSQL:
  I have a Table that has 3 columns:</p>
  
  <p><code>CustomerNum, OrderNum, OrderDate</code>.  </p>
  
  <p>There may(or may not) be many orders for each customer per date range. What I am needing is the last OrderNum for each Customer that lies in the date range that is supplied. 
  What I have been doing is getting a ResultSet of the customers and querying each one separately, but this is taking too much time.</p>
  
  <p>Is there any way of using a sub-select to select out the customers, then get the last OrderNum for each Customer?</p>