MySql mutliple tables
Posted
by Chris Harrison
on Stack Overflow
See other posts from Stack Overflow
or by Chris Harrison
Published on 2010-04-19T07:41:15Z
Indexed on
2010/04/19
7:43 UTC
Read the original article
Hit count: 161
mysql-query
|mysql
I've been looking into JOIN, subqueries and other ways of doing this, but I can't work out the best way to do this is...
I have a table (ps_category_product): id_product, id_category
I want to perform a query on it like: SELECT id_product FROM ps_category_product WHERE id_category='$this_cat'
BUT, I only want to perform this query where the ID's are returned by a query on another table (ps_product): id_product, active
SELECT id_product FROM ps_product WHERE active='1'
Can anyone help me with getting these two queries working together?
© Stack Overflow or respective owner