title: SQL Query with join for 2 tables and create new set of columns in result with multiple foreign key in 2nd table
body: <p>Good day,</p>
  <p>I'm trying to get a new list of query result from 2 tables. Here's the sample structure below:</p>
  <p>Table1</p>
  <pre><code>| id | name |
  | 11  | Mic  |
  | 22  | Jeff |
  | 33  | Tom  |
  </code></pre>
  <p>while the 2nd table is something like this.
  Table2</p>
  <pre><code>| id | note | customerId1 | customerId2 | customerId3
  | 1  | test | 11          | 11          | 22
  | 2  | test |             | 33          | 
  </code></pre>
  <p>So the result should be something like this:</p>
  <pre><code>| id | note | customer1 | customer2 | customer3 |
  | 1  | test | Mic       | Mic       | Tom       |
  | 2  | test |           | Tom       |           |
  </code></pre>
  <p>What I tried so far is using left join, like this:</p>
  <pre><code>SELECT Table2.note, Table2.customerId1 as customer1, Table2.customerId2 as customer2,
         Table2.customerId13 as customer3
  FROM Table2
      LEFT JOIN Table1 ON Table2.customerId1 = Table1.Id
  </code></pre>
  <p>But this isnt' enough is my requirement.</p>
  <p>I hope someone can help with this. Thank you.</p>