title: Join tables using column value as table name
body: <p>I've read many questions about joining tables where the column value is used as a table name but I do not know how to implement it on my case.</p>
  
  <p>I have multiple tables. First Table is <code>user</code>.</p>
  
  <pre><code>    id   |  user_id  |  user_role
      1    |     1     |   admin
      2    |     2     |   manager
      3    |     3     |  employee
  </code></pre>
  
  <p>Second table is <code>admin</code>.</p>
  
  <pre><code>    id    |   fname  |  lname
      1     |   A1     |    J
      2     |   A2     |    C
      3     |   A3     |    S
  </code></pre>
  
  <p>Third table is <code>manager</code>.</p>
  
  <pre><code>    id      |   fname  |  lname
      1       |   M1     |    J
      2       |   M2     |    C
      3       |   M3     |    S
  </code></pre>
  
  <p>Third table is <code>employee</code>.</p>
  
  <pre><code>    id       |   fname  |  lname
      1        |   E1     |    J
      2        |   E2     |    C
      3        |   E3     |    S
  </code></pre>
  
  <p>How can I make it something like this:</p>
  
  <pre><code>SELECT * FROM user u INNER JOIN user.user_role ur ON ur.id = u.user_id
  </code></pre>
  
  <p>So it would yield something likes</p>
  
  <pre><code>u.id | u.user_id | u.user_role | ur.id |  ur.fname | ur.lname
   1   |    1      |   admin     |   1   |     A1    |    J
   2   |    2      |  manager    |   2   |     M2    |    C
   3   |    3      |  employee   |   3   |     E3    |    S
  </code></pre>