
August 4th, 2004, 10:13 AM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
querying two tables in one statement
i am new to sql but im learning an wondered if anyone can help me with this problem. i have four tables but need to find info from two of them in the one select statement,
the tables i have are
Order(Order_No, Part_no)
Part(Part_No, Part_description, Part_Price)
i need to find the parts which were ordered on order number 10 and their prices.
so far i have this
select Order.Part_No, Part.Part_price
from order, part
where Order.order_no = 10 AND Order.Part_No = Part.Part_No
but i know this isnt right as i would have to find the part numbers from the first table and use these to query the second table to get the prices but i dont know how to do this using one statement instead of it being long winded and using two or is that what i have to do?
can anyone help??? this is probably simple to you guys after reading the more advanced posts!!!
|