I am looking for a way to iterate over result set that has columns id1, id2 and pass the resultset column values to be used in inner query as shown below.
Var