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 |
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2006-08-05 : 02:39:26
|
| If I have a table such aseCOL13333333312341309130913091309is there a way to have a query number the similiar itemsCOL1 COL21,33332,33331,12341,13092,13093,13094,1309thanks. |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-08-05 : 04:05:11
|
Somthing like this Declare @Tbl Table (i int,j int IDENTITY(1,1))Insert @Tbl Select 3333 Union All Select 3333 Union All Select 1234 Union All Select 1309 Union All Select 1309 Union All Select 1309 Union All Select 1309Select (Select Count(1) From @Tbl t1 Where t1.i= t.i and t1.j<=t.j ) , i From @Tbl t Chirag |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-08-05 : 04:54:42
|
| Where do you want to show data?If you use front end application,do numbering thereMadhivananFailing to plan is Planning to fail |
 |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2006-08-05 : 12:38:33
|
| I don't really want to show the data, I want to create another table with it, the front end option does not look like it will work. I have yet to try the other. |
 |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2006-08-05 : 14:41:53
|
| Chirag,That works perfect Thanks! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-08-07 : 08:38:34
|
quote: Originally posted by Vinnie881 I don't really want to show the data, I want to create another table with it, the front end option does not look like it will work. I have yet to try the other.
You can also trySelect identity(int,1,1) as row_id,* into NewTablefrom oldTableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|