Thanks Evan, this was very helpful, and I was able to implement my requirement. However I've another follow up question-
If I have to delete a record from within a group, is there a way the other sequence numbers can be re-arranged? For instance if I have following data in the table:
AL - P1-1
AL - P2-2
AK - P1-1
AK - P2-2
AK - P3-3
CA - P4-1
CA - P5-2
And say, "AK-P2-2" is deleted, I want to be able to implement the following:
AL - P1-1
AL - P2-2
AK - P1-1
AK - P2-2 --> DELETED
AK - P3-2 --> The sequence number is changed from 3 to 2CA - P4-1
CA - P5-2
Thanks.