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 |
|
sqlspider
Starting Member
16 Posts |
Posted - 2005-09-01 : 13:04:37
|
| How can I issue a SQL statement to assign incrementing numbers starting from a particular row. For e.g.,col1 col2----- -----aaa 123 ... 345xxx 001yyy 002zzz 003I would like to have numbering in col2 to start where col1=XXX to ZZZ.Thank you |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-02 : 01:35:21
|
| Try thisSelect col1, (Select count(*) from yourTable where col1<=T.col1) as col2 from yorTable TMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|