database - mysql SELECT WHERE and SELECT again -


i have 2 tables customers , customer_orders. i'm trying select customer's order using customer_id customer table.

select * customer_orders customer_id = select id customers customer_name = 'john doe' 

this code not work. how do this?

you need join 2 tables , query need. this:

select co.*  customer_orders co  inner join customers c on co.customer_id = c.id  c.customer_name = 'john doe';