Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query help???

Author  Topic 

rocketscience
Starting Member

3 Posts

Posted - 2001-07-26 : 09:43:42
I have 3 tables:
Make
Model
Inventory

Make contains: MakeID(int,key) and MakeName(varchar)
Model contains: ModelID(int,key),MakeID(int),ModelName(varchar)
Inventory contains VehicleID(int,key),Make(int), Model(int), Color(varchar),
Title(varchar), Description(varchar)

I need help with an inner join query that selects all from inventory where
model = something and that will connect Make(in inventory) to MakeName(in
Make) and Model(in inventory) to ModelName(in Model).

This is where I am stuck....

SELECT *
FROM inventory inner join make on inventory.make = make.makeid
Where model = 1

This works for returning everything but the model name.... how can I add:

inner join model on inventory.model = model.modelid to the above query?

Chris


Learn to share and we all learn.
   

- Advertisement -