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 |
hai
Yak Posting Veteran
84 Posts |
Posted - 2007-07-20 : 15:47:43
|
I need to update the column change move up 1. If it null than begin with R1, if it has value then add 1 up. eg:id Values1 - R11 - R21 - R31 - Null2 - Null3 - R13 - R23 - Null4 - R14 - NullUpdate Resultid Values1 - R41 - R31 - R21 - R12 - R13 - R33 - R23 - R14 - R24 - R1 |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-07-20 : 16:39:40
|
Is there any PK in the table?Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-07-20 : 22:34:34
|
Sounds to me you did not have the correct concept of how records are store in table.There isn't a FIRST or LAST record of a table. Records are not stored in any particular order in a table. You determine the order of how you want the record to retrieve using the ORDER BY clause (with ASC or DESC) in the SELECT statement. KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|