I need to join two tables with a shared ID, but I only want to return a row if both tables contain a row. I found a solution with sub-queries, but want to avoid them (because this query is run multiple times a page load).
An example:
`Products`:
Name PicID
------|-------
Test1 | 4
Test2 | 5
`Images`:
PicID Picture
------|--------
4 | BLOB
A query would only return Test1 (with the blob) because Test2 doesn’t have a row in the picture table.
Thoughts?
Max
An
INNER JOINis used to guarantee that the matching values exist in both tables.