Gossamer Forum
Home : General : Databases and SQL :

Joining Tables in a query...

Quote Reply
Joining Tables in a query...
I currently have two tables I successfully perform keyword searches on. I now want to add a third table to the same query. Since I'm just an amatuer trying to solve someone elses mess, I having difficulty figuring this one out myself. This is what I have...

table 1: "Company" column 1: "CompanyID"

table 2: "Contact" column 1: "ContactID"

column 2: "ProductLines"

Original working query:

SELECT * FROM Company LEFT JOIN Contact on Company.CompanyID=Contact.ContactID

I wish to add a third table...

table 3: "ProductItems" column 1: "ProductLines"

column 2: "ProductItems"



The thing I'm having trouble with is how to nest these tables correctly. The reason for 3 separate tables is that each "Contact" carries many different "ProductItems" under many different "ProductLines", and, each "Contact" may serve more than one "Company". I already do keyword searches on companies and product lines, but I now want to add this third table to extend the same keyword search to the data in the product item fields.

I hope all this made sense.
Subject Author Views Date
Thread Joining Tables in a query... jharwood 6735 Sep 21, 2003, 3:44 PM
Thread Re: [jharwood] Joining Tables in a query...
Stealth 6419 Sep 21, 2003, 8:16 PM
Thread Re: [Stealth] Joining Tables in a query...
jharwood 6485 Sep 22, 2003, 12:00 AM
Thread Re: [jharwood] Joining Tables in a query...
jharwood 6406 Sep 22, 2003, 12:03 PM
Post Re: [jharwood] Joining Tables in a query...
Stealth 6374 Sep 22, 2003, 12:57 PM