enter image description here
| 时间戳|动作| action |
| --|--| ------------ |
| 2020-03-27 14:33:06|超时| timeout |
| 2020-04-02 08:53:15|确认| confirmed |
| 2020-04-12 23:29:44|确认| confirmed |
| 2020-05-16 22:20:24|超时| timeout |
| 2020-07-06 17:39:03|超时| timeout |
| 2020-09-28 06:27:34|超时| timeout |
| 2020-01-12 14:54:19|确信| confired |
我能够使用自连接解决
从确认c1中选择不同的c1.user_id=c2.user_id和c1.time_stamp上的确认c2!=c2.time_stamp其中TIMESTAMPDIFF(SECOND,c1.time_stamp,c2.time_stamp)<= 86400和TIMESTAMPDIFF(SECOND,c1.time_stamp,c2.time_stamp)>=0按1排序;
1条答案
按热度按时间0s0u357o1#
使用
exists
子查询检查任何confirmed
操作是否在24小时内有后续confirmed
操作:字符串
Try it online!