Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Those never ending questions on TOP

Author  Topic 

nizmaylo
Constraint Violating Yak Guru

258 Posts

Posted - 2001-08-28 : 14:32:30
In the select statement below

SELECT TOP 50 S.ItemID, I.Title,
DatePosted=Convert(varchar, I.DatePosted, 101),
I.URL, Rating=Count(*)
FROM #SearchResults S,
vActiveItems I
WHERE S.ItemID = I.ItemID
Group by S.ItemID, I.Title, I.DatePosted, I.URL
Order by 5 DESC, 3 DESC

graz returns results of TOP 50 ranked articles.

Let's say I would like to add another column to the temp table called CHAPTER and populate it with ADMINISTRATION, DEVELOPER, GENERAL, etc.

How do I return TOP 50 FOR EACH CHAPTER without using a cursor and another temp table ???

helena
   

- Advertisement -