Suppose I have a SELECT statement that returns some set of results. Is there some way I can number my results in the following way:
SELECT TOP 3 Name FR
With SQL 2000 you need to use a correlated sub-query.
SELECT ( SELECT COUNT(*) FROM PuppyNames b WHERE b.Popularity <= a.Popularity ) AS Ranking , a.Name FROM PuppyNames a ORDER BY a.Popularity