Reputation: 12705
I'm stuck within this simple scenario:
tableA
| ID | TableB_ID | Name |
tableA 1 ---> * tableB
tableB
| ID | Status_ID |
and I need to retrieve the Name
column values from the tableA
, whose contains rows in the tableB
with Status_ID = 1 and Status_ID = 2 (two separate rows, it can be more with other values but it doesn't matter here)
Upvotes: 0
Views: 35
Reputation:
Try this:
SELECT A.NAME
FROM TABLE_A AS A INNER JOIN TABLE_B AS B ON A.TABLEB_ID = B.ID
WHERE B.STATUS_ID IN (1, 2) -- OR OTHER VALUES
Upvotes: 2