title: MYSQL: Left join same table twice with same field
body: <p>I have a users table that stores admin and normal customers:</p>
  
  <pre><code>ID  Name    Role
  1   John    Admin
  2   Sara    User
  3   Pete    User
  4   Nick    User
  </code></pre>
  
  <p>Another Table that stores requests:</p>
  
  <pre><code>ID  Updatedby    Createdby DateCreated  DateUpdated
  1   1              2        10/12/2017   21/01/2018
  2   1              1        11/12/2017   22/01/2018
  3   1              3        12/12/2017   23/01/2018
  4   2              2        13/12/2017   24/01/2018
  </code></pre>
  
  <p>I am trying to create a view that looks like this:</p>
  
  <pre><code>ID  Updatedby    Createdby DateCreated  DateUpdated
  1   John           Sara     10/12/2017   21/01/2018
  2   John           John     11/12/2017   22/01/2018
  3   John           Pete     12/12/2017   23/01/2018
  4   Sara           Sara     13/12/2017   24/01/2018
  </code></pre>
  
  <p>The problem I am facing when creating the query is, I am trying to left join to the user table twice. How do I specify whether the Users.Name is for Updatedby or Createdby? This is what I mean:</p>
  
  <pre><code>SELECT
     request.ID,
     users.Name, /*name for Createdby */
     users.Name, /*name for Updatedby */
     requests.DateCreated,
     requests.DateUpdated
  FROM
     requests
  LEFT JOIN
     users ON requests.Updatedby = users.ID
  </code></pre>
  
  <p>I can't get my head around the logic with this.</p>