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 |
|
jparker
Posting Yak Master
118 Posts |
Posted - 2007-03-05 : 10:30:45
|
| HelloI want to achieve an incremental id per pack type. So for example I have an output of Pack ID | Firstname | Surname |8 | Andrew | Flintoff |8 | Jacob | Oram |10 | Andy | Pandy |10 | Super | Ted |10 | Banana | Man |what I want to achieve is ID | Pack ID | Firstname | Surname |1 | 8 | Andrew | Flintoff |2 | 8 | Jacob | Oram |1 | 10 | Andy | Pandy |2 | 10 | Super | Ted |3 | 10 | Banana | Man |Where ID is a new incremental pack countI can of course do it with a series of temporary tables or a loop of sorts but wondered what the consensus of opinion was to most efficiently provide this via a select statementYour thoughts would be most appreciated |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-03-05 : 11:15:49
|
| http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspxpoint 1Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
jparker
Posting Yak Master
118 Posts |
Posted - 2007-03-05 : 11:27:54
|
| Thanks |
 |
|
|
|
|
|