title: fetch value from multiple table
body: <p>I have a table t1:</p>
  
  <pre><code>c1 c2 
  1  a
  2  b
  3  a
  </code></pre>
  
  <p>table t2:</p>
  
  <pre><code>c3  c4
  4    1
  5    2
  6    3
  </code></pre>
  
  <p>I am writing a procedure:</p>
  
  <pre><code>select c1 from t1 where c2 = 'a'; 
  </code></pre>
  
  <p>which will give multiple outputs. Use that output (1,3)</p>
  
  <pre><code>select c3 from t2 where c4 = 1,
  
  select c3 from t2 where c4 = 3 -- out put of first query;
  </code></pre>
  
  <p>How do I implement it ? Should i use any loops? If so, how do I loop or how do I write a procedure which returns the result of it?</p>