title: Oracle PL/SQL set column names using other table
body: <p>I'm struggling with naming columns in one table, using a reference table containing these names. I'm sure it should be possible, but I can't seem to find the right solution or think of the correct logic to achieve it...</p>
  
  <p>Situation: I got 2 tables, one with data, columns having descriptive names, and one with a translation of these column names to meaningful names (reference table, or 'codebook').</p>
  
  <p>I'm looking for a way to return the data of the first table, with the names of the columns given in the second column of the second table.</p>
  
  <p>Tables look like:</p>
  
  <pre><code>dataTable:
  q1,q2,q3
  1,2,3
  4,5,6
  </code></pre>
  
  <p>and </p>
  
  <pre><code>translationTable:
  descName, meanName
  q1, meaning1
  q2, meaning2
  q3, meaning3
  </code></pre>
  
  <p>Result should be:</p>
  
  <pre><code>meaning1,meaning2,meaning3
  1,2,3
  4,5,6
  </code></pre>
  
  <p>Help would be highly appreciated!</p>