Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking 3 tables 1

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
0
0
US
I have 3 tables

Orders
pk OrderID
CustId


OrderItems
pk OrderItemID
fk OrderID
fk productid
qty

Products
pk ProductId
ProductDescription


I want to get this result

CustID Qty ProductDescription
Smith 4 Meter

Thanks in advance.



AJ
[americanflag]

Do you feel lucky?


 
SELECT CustID,qty,ProductDescription
FROM Orders A INNER JOIN Orderitems B ON B.OrderID=A.OrderID
INNER JOIN Products C ON C.ProductId=B.ProductId

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top