title: SQL query dynamic table name in FOR
body: <p>I have a table <strong>tbl1</strong> which has a column <strong>tbl_names</strong>. This column contains the name of some other tables.<br>
  Now I want to write a query in the following format:<br>
  <code>select * from (select tbl_names from tbl1)</code>  </p>
  
  <p>I know that the query above will not work but how I can achieve this? Do I need to write a stored procedure or something like that and loop on each value of second query and execute first query?  </p>
  
  <p>Thanks</p>