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
 Transact-SQL (2000)
 row number

Author  Topic 

helpme
Posting Yak Master

141 Posts

Posted - 2005-01-10 : 16:14:36
I have a select that returns a group of numbers. I would like to add a row number to this set.

current

1111111
3333333
5555555
7777777
9999999

would like to do this:


1 1111111
2 3333333
3 5555555
4 7777777
5 9999999


How can I do this?

Hippi
Yak Posting Veteran

63 Posts

Posted - 2005-01-10 : 16:27:14
quote:
Originally posted by helpme

I have a select that returns a group of numbers. I would like to add a row number to this set.

current

1111111
3333333
5555555
7777777
9999999

would like to do this:


1 1111111
2 3333333
3 5555555
4 7777777
5 9999999


How can I do this?



Do a search for identity in this forum first, Tugggan has posted the solution for the same problem
Go to Top of Page

helpme
Posting Yak Master

141 Posts

Posted - 2005-01-10 : 18:24:02
Can you provide a link?
Go to Top of Page

helpme
Posting Yak Master

141 Posts

Posted - 2005-01-10 : 18:36:00
this is similar to what I'm trying, but if I have the table create in it (including
the row number column), it doesn't work. If I don't include the table create,
I get results, but it obviously doesn't include the row number column which I need.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=43864
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-01-10 : 18:56:43
The link: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=44461

Check out Jeff's post though.

Tara
Go to Top of Page

helpme
Posting Yak Master

141 Posts

Posted - 2005-01-10 : 19:03:18
Thanks Tara
Go to Top of Page
   

- Advertisement -