Results 1 to 2 of 2

Thread: sql help

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Location
    dallas,texasd
    Posts
    26

    sql help

    If you will notice in the bottom left hand corner the ProductCategoryName Column is producing two and three results on the same product and these products are not in the categories table, this categories table is where the ProductCategoryName is at so i am not sure what is going on here.

    I am including a photo on a url so that you may have a look at the web site.

    http://afcc1.com/sqlHELP

    ==============================================
    I NEED the ProductID , ProductCategoryName , and the CompanyID

    WHERE the companyid = @idcompany

    and Categories.Productcategoryid = 20 (0r something like this)
    =============================================

    I need someone who has knows sql to take a peek at this and let me know what i need to add or do to receive the proper result.
    Thank you!

    http://afcc1.com/sqlHELP

    Erik

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: sql help

    Try this

    Code:
    SELECT P.ProductId, CA.ProductCategoryName,
    CO.CompanyId FROM
    PRODUCT P
    LEFT JOIN Categories CA
    ON
    P.ProductCategoryId = CA.ProductCategoryId
    LEFT JOIN
    Company CO
    ON
    P.CompanyId = CO.CompanyId
    WHERE
    CA.ProductCategoryId = 20

Posting Permissions

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



Click Here to Expand Forum to Full Width