Use the value from a field in a table as a select statement
<p>I am trying to figure out how to use the values from a table as a select statement for example </p>

<p>table1 contains: 
column- cl1
Value - numb</p>

<p>table2:
column - numb
values 1,2,3,4</p>

<p>i want to select cl1 (value: numb) and then use it to run a statement </p>

<pre><code>select numb from table2
</code></pre>

<p>so far i have used </p>

<pre><code>select (select cl1 from table1) from table2;
</code></pre>

<p>this returns numb 4 times but i want the actual values</p>

<p>the output that i expect is 
1,2,3,4. </p>

<p>I want the query to select from table 1 which will return the field name and then use that field name(numb) as part of the select statement so expecting the end sql to look like:</p>

<pre><code>select numb from table2; 
</code></pre>

<p>However <em>numb</em> will be whatever is in table1;</p>