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
 General SQL Server Forums
 New to SQL Server Programming
 row number

Author  Topic 

girish.gb19
Starting Member

1 Post

Posted - 2010-10-12 : 23:28:29
I want to generate the row number for the following entries in the table as shown below

100 1
100 1
101 2
165 3
100 4
100 4
100 4
165 5
165 5
165 5
165 5

i.e., i want to generate the different row number for the consecutive same entries in the table

I would appreciate & thankful for the sooner replies
Thanks in Advance


GB

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2010-10-12 : 23:33:51
You are going to need some other columns in your table that establishes the sequence of the rows. You can't know what are "consecutive" rows without some other column or columns to ORDER BY.

Be One with the Optimizer
TG
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-10-26 : 11:49:21
Quirky update may help you
http://beyondrelational.com/blogs/madhivanan/archive/2009/06/10/quirky-update-in-sql-server.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -