MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old July 7th, 2000, 10:31 AM
NSupremo NSupremo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 4 NSupremo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old July 7th, 2000, 11:03 AM
NSupremo NSupremo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 4 NSupremo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Inner Joins


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway