MyQL JOIN query
Posted on 2010-09-05
I am trying to write a query that joins two tables together
The first table is called customers and the info I need from that table is customerid, name and email
The second table is called orders and it also contains the customerid. This table also contains a column called order_status and this holds the key to the query.
In laymen’s language the query should be:
I need customerid, name, email from table customers (join table customers on table orders using customerid as the joiner) where order_status is equal to “FULL”
I have tried this myself and come up with:
SELECT customerid, name, email
FROM customers JOIN orders ON customers. customerid = customers.customerid
WHERE order_status = FULL
But this does not work
Assistance much appreciated.