Row Number for group by ?
- by Damien Joe
I have table structure like
Category EmpName
1 Harry
1 John
1 Ford
2 James
2 Mark
2 Shane
3 Oliver
3 Ted
I want results like
Category EmpName RowNumber
1 Harry 1
1 John 2
1 Ford 3
2 James 1
2 Mark 2
2 Shane 3
3 Oliver 1
3 Ted 2
I am using db2 and row_number() is not working for different groups of records.