View Full Version : Complicated query


danb
01-29-2006, 01:25 PM
Hi,

I've got the following MS SQL tables:


tblProduct
----------
Product_Id | Product_ManufacturerCode


tblProductDetail
---------------
ProductDetail_Id | ProductDetail_ManufacturerCode | ProductDetail_CategoryId


tblCategory
-----------
Category_Id | Category_Name




tblProductDetail is a huge table supplied by an external supplier. I only need the records where we have products in the tblProduct table.

What I need to do is to select all distinct Category_Name values where tblProductDetail has a record in tblProduct.

Does anyone know how to do this?

Thanks very much...