rhovey1
SSC Rookie
Points: 43
More actions
December 2, 2003 at 3:52 pm
#176958
I am trying to select the top 20 results for each group within my query. Any suggestions?
mbarrentine
SSC Enthusiast
Points: 112
December 2, 2003 at 9:12 pm
#484392
Here's a working example using the Northwind DB:
USE Northwind
SELECT P.*
FROM Products P
WHERE P.ProductID IN ( SELECT TOP 2 G.ProductID
FROM Products G
WHERE G.CategoryID = P.CategoryID
)
ORDER BY P.CategoryID
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply