title: SQL Find latest record only if COMPLETE field is 0
body: <p>I have a table with multiple records submitted by a user. In each record is a field called COMPLETE to indicate if a record is fully completed or not.</p>
  
  <p>I need a way to get the latest records of the user where COMPLETE is 0, LOCATION, DATE are the same and no additional record exist where COMPLETE is 1. In each record there are additional fields such as Type, AMOUNT, Total, etc. These can be different, even though the USER, LOCATION, and DATE are the same.</p>
  
  <p>There is a SUB_DATE field and ID field that denote the day the submission was made and auto incremented ID number. Here is the table:</p>
  
  <pre><code>ID  NAME  LOCATION  DATE       COMPLETE  SUB_DATE   TYPE1  AMOUNT1  TYPE2  AMOUNT2  TOTAL
  1   user1   loc1    2017-09-15    1      2017-09-10  Food   12.25   Hotel  65.54   77.79
  2   user1   loc1    2017-09-15    0      2017-09-11  Food   12.25   NULL      0   12.25
  3   user1   loc2    2017-08-13    0      2017-09-05  Flight 140     Food      5   145.00
  4   user1   loc2    2017-08-13    0      2017-09-10  Flight 140     NULL      0   140
  5   user1   loc3    2017-07-14    0      2017-07-15  Taxi   25      NULL      0   25
  6   user1   loc3    2017-08-25    1      2017-08-26  Food   45      NULL      0   45
  </code></pre>
  
  <p>The results I would like is to retrieve are ID 4, because the SUB_DATE is later that ID 3. Which it has the same Name, Location, and Date information and there is no COMPLETE with a 1 value. </p>
  
  <p>I would also like to retrieve ID 5, since it is the latest record for the User, Location, Date, and Complete is 0. </p>
  
  <p>I would also appreciate it if you could explain your answer to help me understand what is happening in the solution.</p>