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 |
|
CKHong
Starting Member
13 Posts |
Posted - 2010-03-26 : 02:26:54
|
| [RowAsc] [countID] [Title]1 1 AA2 1 AA3 1 AA4 1 BB5 1 BB6 1 BB7 1 BB8 1 BB1 2 AA2 2 AA3 2 AA4 2 AA5 2 BB6 2 BB7 2 BB8 2 BBThe RowAsc result i got it from a query :Row_Number()OVER(Partition by A.CountID Order by A.Title) AS rowAscI wanted to get the result as below:[RowAsc] [countID] [Title]1 1 AA2 1 AA3 1 AA1 1 BB2 1 BB3 1 BB4 1 BB5 1 BB1 2 AA2 2 AA3 2 AA4 2 AA1 2 BB2 2 BB3 2 BB4 2 BBAny idea ?? |
|
|
CKHong
Starting Member
13 Posts |
Posted - 2010-03-26 : 02:32:46
|
| opps... just found out the solution... here it is :Row_Number()OVER(Partition by A.CountID, A.Title Order by A.Title) AS rowAsc:D |
 |
|
|
haroon2k9
Constraint Violating Yak Guru
328 Posts |
Posted - 2010-03-26 : 02:39:04
|
| Good |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-03-26 : 02:39:59
|
| Good! Great to share here!Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-03-26 : 02:51:27
|
that's good. CKHong boleh.  KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
CKHong
Starting Member
13 Posts |
Posted - 2010-03-26 : 06:10:01
|
| HAHAHAAA... thx...b4 tat.. duno can put 2 partition.. lol ~~thx thx... |
 |
|
|
|
|
|