title: select table name to join from SQL query
body: <p>In current database design, I have a main table called "Leads" and some other tables starting with product_ ( product_life_insurance, product_medical_insurance , ... )</p>
  
  <pre><code>-Leads Table :
  --ID
  --Product
  ...
  
  -Product_Life_insurance Table :
  --ID
  --LeadID
  ...
  </code></pre>
  
  <p>a Lead Row :</p>
  
  <pre><code>ID 5
  Product: life_insurance
  </code></pre>
  
  <p>a product_life_insurance Row:</p>
  
  <pre><code>ID 1
  LeadId 5
  </code></pre>
  
  <p>..</p>
  
  <p>Is there anyway to create a query to select table Name from Leads and add "product_" prefix to it and then join it to product table ?</p>
  
  <p>I mean :</p>
  
  <pre><code>SELECT *
  FROM `leads` JOIN `product_life_insurance` ON `leads`.`id` = `product_life_insurance`.`leadID`
  WHERE `leads`.`id` = '5';
  </code></pre>
  
  <p>I want to select table name for join from <code>leads</code> table and add "product_" prefix to it and use it in my query.</p>
  
  <p>Thanks :)</p>