Use the following to display the sequence numbers as per each group
select
myGroupID,
myGROUPCOUNTER = ROW_NUMBER() OVER (PARTITION BY [myGroupID] ORDER BY [myGroupID])
from
myGroupTable
select
myGroupID,
myGROUPCOUNTER = ROW_NUMBER() OVER (PARTITION BY [myGroupID] ORDER BY [myGroupID])
from
myGroupTable
No comments:
Post a Comment