Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DISTINCT SQL Problem

Status
Not open for further replies.

JohannIcon

Programmer
Sep 3, 2002
440
MT
Dear All,

I have a query where I want to select the top 3 portfolio Items, however these must have distinct Category names. Here is the SQL which I came up with, however it is not working:-

SELECT TOP 3 portfolio.*,DISTINCT [category].[CatName] FROM portfolio INNER JOIN category ON [portfolio].[catID]=[category].[catID] ORDER BY CatName ASC, portfolioID DESC"

Can you please help me out.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top