Charlie Davey
Charlie Davey

Reputation: 90

SELECT all from two tables where IDs match

I am trying to find all results from my product table that id's exist in another table. I was thinking maybe something like this might work:

SELECT * 
FROM Product AS p 
JOIN Resource_Downloads_History AS r 
WHERE p.Resource_Id = 3 
  AND r.Resource_Id = 3'`

Many thanks if anyone can help point me in the correct direction and tell me what I have done wrong.

Upvotes: 1

Views: 5814

Answers (1)

pierroz
pierroz

Reputation: 7890

SELECT * 
FROM Product AS p 
JOIN Resource_Downloads_History AS r
  ON r.Resource_Id = p.Resource_Id

Upvotes: 9

Related Questions