SELECT * FROM my_table WHERE col_1 IN (select id from something) AND col_2 IN (select id from something_else)