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)
 returning a counter in a select statment

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-28 : 00:01:14
aaron writes "is there any way to get a counter in a select statement eg:

i have a table called user wich looks like this

 userID   credits
1 400
2 200
3 300
4 250
and i want to select all of that table and ORDER BY credits my problem is that i want to have the result come out with a rank next to it

 rank   userID   credits
1 1 400
2 3 300
3 4 250
4 2 200
I think that the rank could come out as it is just counting however everyone that i have talked to says that it cant be done."
   

- Advertisement -