title: MYSQL query using variable as table name in LEFT JOIN
body: <pre><code>SELECT var1,var2,var3,table_name 
  FROM table1 LEFT JOIN table_name on var3=table_name.id
  </code></pre>
  
  <p>Meaning I want to dynamically left join table, depending on value of <code>table_name</code> from <code>table1</code>, since <code>var3</code> is taken from there.</p>
  
  <p>But the above query results in </p>
  
  <blockquote>
    <p>table table_name does not exist</p>
  </blockquote>
  
  <p>My mistake of mysql limitation?</p>