title: PLSQL & Oracle - Join 2 tables and only return based on latest date
body: <p>this is a question for plsql &amp; oracles. I am new to this. Please help!</p>
  
  <p>I have 2 tables: Table A and Table B</p>
  
  <pre><code>Table A: ID, Date
  Table B: Name, Address
  </code></pre>
  
  <p>How do I do a join between 2 tables and then have it just return based on latest date. Also, it will be based on specified ID in a list.</p>
  
  <p>My current query returns this:</p>
  
  <pre><code>1 | 1/1/2013 | Apple | 123 Malcolm
  1 | 1/2/2013 | Apple | 123 Malcolm
  1 | 1/3/2013 | Apple | 123 Malcolm
  3 | 1/1/2013 | Orange| 124 Malcolm
  3 | 1/2/2013 | Orange| 124 Malcolm
  </code></pre>
  
  <p>How do I get it to return just:</p>
  
  <pre><code>1 | 1/3/2013 | Apple | 123 Malcolm
  3 | 1/2/2013 | Orange| 124 Malcolm
  
  select unique(ID), a.Date, b.Name, b.Address
  from tableA a
  join tableB b
  on a.ID = b.ID
  where a.Date &gt; TO_DATE('12/31/2012', 'mm/dd/yyyy') and a.ID in ('1', '3')   
  </code></pre>
  
  <p>Thanks!</p>