I have one query that returns multiple rows, and another query in which I want to set criteria to be either one of values from those multiple rows , so basicly I want the su
You can use in():
select * 
from table
where id in (multiple row query)
or use a join:
select distinct t.* 
from source_of_id_table s
join table t on t.id = s.t_id
where 
 
The join is never a worse choice for performance, and depending on the exact situation and the database you're using, can give much better performance.