title: For each row from select insert multiple rows into one table
body: <p>I want to do something like this</p>
  
  <pre><code>SELECT ID, X, Y, Z FROM TABLE_1
  </code></pre>
  
  <p>this returns me something like:</p>
  
  <pre><code>| IDTABLE_1 |  X  |  Y  |  Z  |
  | 1         |  a  |  b  |  c  |
  | 2         |  d  |  e  |  f  |
  | 3         |  g  |  h  |  i  |
  </code></pre>
  
  <p>And i have another table TABLE_2 that has a column with the column names from the previous table (TABLE_1):</p>
  
  <pre><code>| IDTABLE_2 | COLUMN | 
  | 101       | X      | 
  | 102       | Y      |
  | 103       | Z      |
  </code></pre>
  
  <p>and now i need to insert all my data from the select into this new table TABLE_3 and it has to be like this:</p>
  
  <pre><code>| IDTABLE_3 | IDTABLE_1 | IDTABLE_2   | VALUE |
  | 201       | 1         | 101         | a     |
  | 202       | 1         | 102         | b     |
  | 203       | 1         | 103         | c     |
  | 204       | 2         | 101         | d     |
  | 205       | 2         | 102         | e     |
  | 206       | 2         | 103         | f     |
  | 207       | 3         | 101         | g     |
  | 208       | 3         | 102         | h     |
  | 209       | 3         | 103         | i     |
  </code></pre>
  
  <p>Any suggestion on a simple way to do it?</p>