I have the following table and data
docRefID docExternalContent
1 'a'
1 'b'
1 'c'
2 'd'
2 'e'
I want to know if it’s possible that query will insert additional colum rowNumber and auto increment based on docRefID e.g
docRefID docExternalContent rowNumber
1 'a' 1
1 'b' 2
1 'c' 3
2 'd' 1
2 'e' 2
and so on…. I tried using ROW_NUMBER() OVER but it is working independent of docRefID.
Any help will be appricated. Thanks
1 Answer