title: MySQL get column names from a query
body: <p>I want to query the column names from a query, something like this:</p>
  
  <pre><code>SHOW COLUMNS FROM 
  (SELECT `f1`, `f2`, `g1`, `g3` FROM `f` INNER JOIN `g` ON `g`.`Id` = `f`.`Id`)
  </code></pre>
  
  <p>And the result be </p>
  
  <pre><code>FIELD
  f1
  f2
  g1
  g3
  </code></pre>
  
  <p>Of course this query is wrong. But is there a way to do that?</p>