I need to perform a summary calculation for the below mentioned table structure for i need to order by "sessionId" and subgroup by the "sequenceId". Particular session can have one or more sequence. each sequence starts with one and move ahead sequencailly. primary keys and flow-squence may not be in tandem.
table >>
pk_id session-id sequence some_other columns
1 AAAAAAAA 1 blah-blah-blah
2 AAAAAAAA 2 blah-blah-blah
3 AAAAAAAA 3 blah-blah-blah
4 AAAAAAAA 2 blah-blah-blah
5 AAAAAAAA 1 blah-blah-blah
6 AAAAAAAA 3 blah-blah-blah
7 AAAAAAAA 3 blah-blah-blah
8 AAAAAAAA 2 blah-blah-blah
9 AAAAAAAA 1 blah-blah-blah
I need to order by
pk_id session-id sequence some_other columns
1 AAAAAAAA 1 blah-blah-blah
2 AAAAAAAA 2 blah-blah-blah
3 AAAAAAAA 3 blah-blah-blah
5 AAAAAAAA 1 blah-blah-blah
4 AAAAAAAA 2 blah-blah-blah
6 AAAAAAAA 3 blah-blah-blah
9 AAAAAAAA 1 blah-blah-blah
8 AAAAAAAA 2 blah-blah-blah
7 AAAAAAAA 3 blah-blah-blah
Any help would be appreciated.