I have input from a tableA in database A that I would like to join to another tableB in database B.
These were my two options:
- Use Database Join: For each input from table in database A, run the join query in database B.
- Use two Input tables (talbeA + tableB) and do merge join on key.
I went with option #1 as I want to avoid reading in tableA and tableB in entirety.
My question is: How can I use all results from a prior step as one "IN" query?
For instance
select *
from tableB b
where b.id IN (all_rows_from_prior_step)
versus (where it runs for each input row)
select *
from tableB b
where b.id = ?