Here is my example:
select row_x from table_1 where row_y = (select row_a from table_2 where row_b = x)
The problem that I am running into is that my query needs to return multiple rows if the subquery returns multiple rows.
Ideally it would translate to something similar to:
'select row_x from table_1 where row_y = '' or row_y = '' etc.
How can I make this happen? Thanks!
解决方案
You are looking for IN clause
select row_x from table_1
where row_y
IN (
select row_a from table_2 where row_b = x
)