"B. Fongo" <[EMAIL PROTECTED]> wrote:
>
> I ' m trying to extra some information from 2 tables using inner join,
> but receive an error warning. Am newbie so I' m not able to feature out
> why my queries don't work.
>
> Scenario:
>
> I have 2 tables: Customers and orders. The have following structures:
> Customers Orders
> cust_id Product
> Name Price
> City cust_id
>
>
> All that am trying to get out of these tables is to use a cust_id of a
> given customer to extract their orders. So I use something like this:
>
> SELECT Customers.Name, Customers.City, Orders.Product, Order.Price from
> Customers WHERE cust_id = 2 inner join Orders ON Customers.cust_id =
> Orders.cust_id
>
> Can anyone help me on this?
SELECT Customers.Name, Customers.City, Orders.Product, Order.Price
FROM Customers INNER JOIN Orders ON Customers.cust_id = Orders.cust_id
WHERE cust_id = 2;
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Egor Egorov
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]