title: SQL - Join two tables without unique fields
body: <p>This is my first post in this forum so please be understanding. </p>
  
  <p>I have following issue. </p>
  
  <p>I want to two join two tables:</p>
  
  <p>Table1:</p>
  
  <pre><code>Product  | Start Date  | End Date
  -------------------------------------
  Product1 | 01/01/2014  | 01/05/2015
  Product2 | 01/03/2014  | 01/01/2015
  </code></pre>
  
  <p>Table2:</p>
  
  <pre><code>Product   | Start Date | End Date   | Value
  --------------------------------------------
  Product1  | 01/01/2014 | 01/02/2015 |  10
  Product1  | 02/02/2014 | 01/04/2015 |  15
  Product1  | 02/04/2014 | 01/05/2015 |  15
  Product2  | 01/03/2014 | 04/05/2014 |   5
  Product2  | 05/05/2014 | 01/01/2015 |   5
  </code></pre>
  
  <p>To have a table with latest value like:</p>
  
  <pre><code>Product   | Start Date   | End Date   | Value
  ------------------------------------------------
  Product1  | 02/04/2014   | 01/05/2015 |   15
  Product2  | 05/05/2014   | 01/01/2015 |    5
  </code></pre>
  
  <p>I need to join them and not use just the second table because both of them have more unique columns that I need to use.</p>
  
  <p>I was thinking about firstly using some kind of IF function on second table to make one row per product (the one with latest start date) and than join it simply then with first table. But I have no idea how to do the first part. </p>
  
  <p>I am really looking forward for your help.</p>
  
  <p>Regards,
  Matt</p>