Thread: Inner Joins

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    4
    Rep 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.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    4
    Rep Power
    0
    I figured out a solution on my own. Picky stuff

    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

Similar Threads

  1. Should I relate tables using joins, or not?
    By lucretius in forum Development Articles
    Replies: 0
    Last Post: November 25th, 2003, 12:37 AM
  2. Joins Again
    By Rhys in forum MySQL Help
    Replies: 1
    Last Post: September 7th, 2003, 04:54 AM
  3. nested inner joins
    By gaagaagui in forum MySQL Help
    Replies: 1
    Last Post: August 16th, 2002, 07:25 AM
  4. Outer joins
    By wolfespawn in forum PostgreSQL Help
    Replies: 4
    Last Post: July 29th, 2002, 03:26 PM
  5. tutorials on joins?
    By strider3700 in forum MySQL Help
    Replies: 1
    Last Post: June 27th, 2000, 07:40 AM

IMN logo majestic logo threadwatch logo seochat tools logo