I have 2 tables set up like this (irrelevant rows omitted):
> product
- id
- user_id
> thread
- id
- prod_id
- user_id
- due_date
now I want to create a query that picks all rows from thread table that either:
- have a thread.user_id of (for example) "5"
- have a prod_id where the product.user_id is "5"
I am assuming there is a way to do this, something like ...
SELECT
thread.due_date
FROM
product, thread
WHERE
thread.user_id='5'
OR
// not sure how to finish it
Up to this point, I would just use PHP to do this, but would really like to kick up my SQL knowledge a notch and get this working via SQL if possible.
Thanks -