title: SQL join query, want to get the latest record of joining table (or null if it doesn't match)
body: <p>I have 2 tables</p>
  <p>User:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>NAME</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>John</td>
  </tr>
  <tr>
  <td>2</td>
  <td>Jane</td>
  </tr>
  <tr>
  <td>3</td>
  <td>Jim</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>login:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>date</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>2021-01-29</td>
  </tr>
  <tr>
  <td>3</td>
  <td>2021-02-27</td>
  </tr>
  <tr>
  <td>1</td>
  <td>2021-03-11</td>
  </tr>
  <tr>
  <td>3</td>
  <td>2021-04-18</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to get the result like:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>name</th>
  <th>date</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>John</td>
  <td>2021-03-11</td>
  </tr>
  <tr>
  <td>Jane</td>
  <td>null</td>
  </tr>
  <tr>
  <td>Jim</td>
  <td>2021-04-18</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>How shall I write the SQL query?</p>
  <p>I tried quite a few join but never got the 2nd record (Jane/Null) out from the query. Need some help here, thanks a ton in advance!</p>