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 |
jimib
Starting Member
3 Posts |
Posted - 2014-07-21 : 14:11:25
|
I have a table like this:
1 a 2 a 3 b 4 b 5 b 6 c
and I need this:
1 a 1 2 a 2 3 b 1 4 b 2 5 b 3 6 c 1
can anyone help? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-07-21 : 14:17:56
|
Use the ROW_NUMBER() function for this.
Tara Kizer SQL Server MVP since 2007 http://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|