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 |
|
pankaj.malhotra
Starting Member
5 Posts |
Posted - 2009-05-13 : 00:52:13
|
| Hi,I have to generate a increment value for combination of 2 other columns. If it finds a duplicate value while combining the other 2 column, it should assign the same value.for exampleLets say we have a table likea b cABC DEF 1ABC DEF 1ABD DEF 2ABE DEF 3ABE DEF 3ABE DEG 4Column C is the increment value. whenever it is finding duplicate value while concatenating Column A and B, It is populating the same value in that column. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-05-13 : 01:02:30
|
use dense_rank() over(order by a, b) KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
pankaj.malhotra
Starting Member
5 Posts |
Posted - 2009-05-13 : 01:37:27
|
| thanx. it works |
 |
|
|
|
|
|