Lets say I have 2 tables, A and B, and they look something like this:
Table A - Orders
+----+-------------+------------+
| ID | Description | Product ID |
+----+-------------+------------+
| 1 | ABC | 4 |
| 2 | DEF | 5 |
| 3 | GHI | 6 |
+----+-------------+------------+
Table B - Products
+----+-------------+
| ID | Name |
+----+-------------+
| 4 | cat |
| 5 | cactus |
| 6 | cow |
+----+-------------+
I want to return results of rows in table A if the "Name" column in table B matches the search term, using something like LIKE %searchterm%
in SQL, if applicable. The basic idea is that based on the product ID in table A it would then look for the row in table B with that ID and then check if the name column matches the search term, and if so return the row from table A with the related product ID.
So the search term was "ca" and the query was run, it would return rows 1 and 2 (cat and cactus) from table A since the products in table B match the search term.