Complicated query (1 Viewer)

danb

Registered User.
Local time
Today, 08:26
Joined
Sep 13, 2003
Messages
98
Hi,

I've got the following MS SQL tables:

Code:
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...
 

SQL_Hell

SQL Server DBA
Local time
Today, 08:26
Joined
Dec 4, 2003
Messages
1,360
Hi

what are the primary / foreign keys and the relationships?
 

Users who are viewing this thread

Top Bottom