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 |
|
ben_53
Yak Posting Veteran
67 Posts |
Posted - 2011-07-28 : 15:31:12
|
| Hi,I want to assign the sequence for a table with 4 columns.col1 is identity, col4 is named seq.now, col2 have only 4 values,Apple,Banana,Strawberry & Blueberry.col3 can have 3 vales,LA, SF & NY.Business logic:sequence should be first according to col1Banana>Blueberry>Apple>Strawberrythen according to col2 depending on col1for banana col2 order = NY>LA>SFfor Blueberry, order = LA>SF>NYand so on...So, It should look like:Banana NY 0001Banana LA 0002Banana SF 0003Blueberry LA 0004Blueberry SF 0005Blueberry NY 0006 and so on...Kindly write a general query for this.mine is not working accordingly.Thanks |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-07-28 : 15:47:23
|
| Dupe: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=163633 |
 |
|
|
|
|
|