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 |
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2010-02-27 : 21:36:29
|
| hiHow do i get row number using group by? for example, i have 2 groups (grpA, grpB) and in group A i have 5 rows and group B i have 8 rows.I would like to display the row number for each group. ThanksGroup A12345Group B12345678 |
|
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2010-02-27 : 22:03:20
|
| i have found the answer:row_number() over (partition by Cust_ID order by Stores) as ROW_NUMBERThanks |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|