|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hello, I currently have a working Inner Join statment.
My main Table is called "Item" I then plug values from Tables "Category" and "Department" I would like to plug in values from an additional Table to exchange a "Item.SupplierID" with the "Supplier.SupplierName" Here is my current query: Select Item.Description,Item.ID,Item.Price,Category.Name,Department.Name From Item Inner Join (Category Inner Join Department ON Category.DepartmentID=Department.ID) ON Item.CategoryID = Category.ID Where Department.Name = 'Pets' Group by Category.Name,Department.Name,Item.Description,Item.Price,Item.ID ----- I tried simply adding the additional Join: ... Inner Join (Category Inner Join (Department Inner Join ( .... )) But that did not work. The Supplier table is not related to the Department and Category Tables. I am using NT4.0, ODBC, Access97 data. Thanks for the help. Please ask if more information is required here. |
|
#2
|
|||
|
|||
|
I figured out a solution on my own. Picky stuff URL
Here is my current Query that does what I want. I guess my next question could be "Can I optimize this query in any way?" Select Item.Description,Item.ID,Item.Price,Category.Name as Cat,Department.Name as Dept,Supplier.SupplierName From (Item Inner Join (Category Inner Join Department ON Category.DepartmentID=Department.ID) ON Item.CategoryID = Category.ID) Inner Join Supplier ON Item.SupplierID = Supplier.ID Where Department.Name = 'Pets' Group by Category.Name,Department.Name,Item.Description,Item.Price,Item.ID,Supplier.SupplierName |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Inner Joins |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|