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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple joins 1

Status
Not open for further replies.

litton1

Technical User
Apr 21, 2005
584
GB
Hi all, having problems with my joins again :(.
I cannot fathom where the brackets go when I have three joins, any help much appreciated.

Code:
 SELECT s.S_SupplierID AS SupplierID, blah, blah
 FROM Suppliers s
     INNER JOIN SupplierProducts sp ON SP_SupplierID = S_SupplierID
    INNER JOIN Products p ON p.P_ItemID = sp.SP_ItemID
    INNER JOIN Items i on p.P_ItemID = i.I_ItemID

Thx T

Age is a consequence of experience
 
SELECT s.S_SupplierID AS SupplierID, blah, blah
FROM ((Suppliers s
INNER JOIN SupplierProducts sp ON SP_SupplierID = S_SupplierID)
INNER JOIN Products p ON p.P_ItemID = sp.SP_ItemID)
INNER JOIN Items i on p.P_ItemID = i.I_ItemID

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks. i can see how this works now.

Age is a consequence of experience
 
This seems not to work?

Code:
 SELECT s.S_SupplierID AS SupplierID
  FROM (( Suppliers s  
  INNER JOIN SupplierProducts sp ON SP_SupplierID = S_SupplierID )  
  INNER JOIN Products p ON p.P_ItemID = sp.SP_ItemID)  
  INNER JOIN Items i on p.P_ItemID = i.I_ItemID

Any ides?

Age is a consequence of experience
 
I'd try this:
INNER JOIN SupplierProducts sp ON [!]sp.[/!]SP_SupplierID = [!]s.[/!]S_SupplierID)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
hmm. I will give myself a slap for that!!

have another star for your trouble.

Age is a consequence of experience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top