Tuesday, June 28, 2011

Sequence Number As Per Each Group

Use the following to display the sequence numbers as per each group


select
         myGroupID, 
         myGROUPCOUNTER = ROW_NUMBER() OVER (PARTITION BY [myGroupIDORDER BY [myGroupID])
from
         myGroupTable



No comments:

Post a Comment