I want to use an array of (id_1)ids from a selection on table_1 to get all rows from table_2 where id_2 = id_1
SELECT field_b
FROM table_2
WHERE id_2 IN (
SELECT id_1 FROM table_1 WHERE field_a = 1234
);
Below are example of my tables for reference:
mysql> select * from table_1;
+-------+---------+
| id_1 | field_a |
+-------+---------+
| 1 | 1234 |
+-------+---------+
| 2 | 1234 |
+-------+---------+
mysql> select * from table_2;
+---------+---------+
| id_2 | field_b |
+---------+---------+
| 1 | 5678 |
+-------+-----------+
| 2 | 0013 |
+-------+-----------+
Would an INNER JOIN work just as well well for you?