• mickyT (3/25/2013)


    You could do something like the following, if you will always have 2 product prices, with 1 that has a quantity of 1.

    select ProductID, ProductName, CategoryID, CategoryName, pp1.ProductQuantity, pp1.ProductCost, ppo.ProductQuantity, ppo.ProductCost

    from Product p

    inner join Category c on p.CategoryID = c.CategoryID

    inner join ProductPricing pp1 on p.ProductID = pp1.productID and pp1.ProductQuantity = 1

    inner join ProductPricing ppo on p.ProductID = ppo.productID and ppo.ProductQuantity <> 1

    If the above solution doesn't get you the expected results....then please post some sample data for further assistance.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉