I hoping someone can help me with a MySQL query.
I am trying to create a query in a MySQL database that finds all rows that matches a string ‘foo’ in column_1 of Table_A and then searches those rows with ‘foo’ and for all values of ‘bar’ in column_2 of Table_A returns all rows in Table_b that contain ‘bar’ in column_8.
My starting query is:
SELECT * FROM TABLE_A WHERE column_1 LIKE 'foo';
The above query only finds all data that matches a string ‘foo’ in column_1 of Table_A. What code do I need to add to take the above results and use Table_A column_2 to search for matches in column_8 of Table_B? I can’t seem to figure out how to perform this query.
Thanks in advance for any help you can provide.
Its not clear from your description if this is right but it sounds like you’re looking for a JOIN