我什至不知道如何问这个问题,但我会举例说明我想要实现的目标。
ID NAME ACTIVITY TIMESTAMP
1 .. book timestamp
1 .. eat timestamp
1 .. sleep timestamp
2 .. apple timestamp
2 .. eat timestamp
2 .. sleep timestamp
2 .. book timestamp
3 .. eat timestamp
3 .. sleep timestamp
3 .. book timestamp
3 .. sleep timestamp
4 .. eat timestamp1
4 .. sleep timestamp1
4 .. sleep timestamp2
4 .. eat timestamp2
只有当下一条记录eat
是sleep
并且它们都具有相同timestamp
和ID
所以输出会。对于此示例,它们都具有相同的时间戳。when ID
=4
它发生了两次,但它有不同的timestamp
.
ID NAME ACTIVITY TIMESTAMP
1 .. eat timestamp
1 .. sleep timestamp
2 .. eat timestamp
2 .. sleep timestamp
3 .. eat timestamp
3 .. sleep timestamp
4 .. eat timestamp1
4 .. sleep timestamp1
4 .. sleep timestamp2
4 .. eat timestamp2