我需要对下面提到的表结构进行汇总计算,因为我需要按“sessionId”排序,按“sequenceId”排序。特定会话可以有一个或多个序列。每个序列都从一个开始并按顺序前进。主键和流序列可能不是串联的。
表>>
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
我需要订购
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
任何帮助,将不胜感激。