I have a table t1:
c1 c2
1 a
2 b
3 a
table t2:
c3 c4
4 1
5 2
6 3
I am writing a procedure:
select c1 from t1 where c2 = 'a';
which will give multiple outputs. Use that output (1,3)
select c3 from t2 where c4 = 1,
select c3 from t2 where c4 = 3 -- out put of first query;
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?