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.
Author |
Topic |
mantis
Starting Member
1 Post |
Posted - 2001-11-29 : 11:05:44
|
Hi,I've to number the records in a SQL query made with SQL Server 2000. I need a field containing the number of that specific row starting from 1 and ending with the number of records retrieved.Example1, Field1, Field2, Field2....., FieldN2, Field1, Field2, Field2....., FieldN3, Field1, Field2, Field2....., FieldN.....N, Field1, Field2, Field2....., FieldNWhere the first field will contain the row number.Can someone help me?ThanksEven the smallest person may change the course of the future! |
|
sica
Posting Yak Master
143 Posts |
Posted - 2001-11-29 : 11:15:08
|
In SQL SERVER 7.0 I would put the result of the query in a temp table with an incremental column and do a new select from the temp table.In SQL SERVER 2000 ,maybe a function would help you...Sica |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2001-11-29 : 17:23:05
|
I don't think a funtion would help too much, but in SQL 2000 using a table variable instead of a temp table is a little faster.Or, this might help get the specific rowshttp://www.sqlteam.com/item.asp?ItemID=566Damian |
|
|
|
|
|
|
|