Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Posts
    50

    Unanswered: Help in Make-Table Query

    Hello everyone

    I have a two tables Products and Suppliers

    in the Products table there's fields such as

    product ID , ProductName, SupplierID etc.

    and in Suppliers table i have fields such as

    SupplierID, CompanyName, CompanyAddress etc.

    What I wanna do is. I wanna make a query that creates a table that shows the number of products that a supplier Supplies.

    so something like this

    Company A - 3 products
    Company B - 2 products
    Company C - 5 products
    and so on..

    can someone tell me how to do that plz

    Thanks in Advance
    Deep

  2. #2
    Join Date
    Jan 2003
    Location
    Pittsburgh, PA
    Posts
    86

    Re: Help in Make-Table Query

    Originally posted by Programmer
    Hello everyone

    I have a two tables Products and Suppliers

    in the Products table there's fields such as

    product ID , ProductName, SupplierID etc.

    and in Suppliers table i have fields such as

    SupplierID, CompanyName, CompanyAddress etc.

    What I wanna do is. I wanna make a query that creates a table that shows the number of products that a supplier Supplies.

    so something like this

    Company A - 3 products
    Company B - 2 products
    Company C - 5 products
    and so on..

    can someone tell me how to do that plz

    Thanks in Advance

    Try:

    SELECT [CompanyName], count([product_id])
    FROM suppliers s, products p
    where s.SupplierID = p.SupplierID
    group by p.SupplierID

    You can either append those results to a table, or create a make table query.

  3. #3
    Join Date
    Nov 2002
    Posts
    50
    yes it works

    Thanks alot
    Deep

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •