mysql 大于40分钟
时间: 2023-10-12 11:04:57 浏览: 111
根据引用中的代码片段,我们可以使用LEAD()函数和TIME_TO_SEC()函数来计算每行之间的时间差,并将时间转换为秒数。然后,我们可以使用这个时间差来筛选出大于40分钟的结果。具体的MySQL查询语句如下:
select *
from (
select *, TIME_TO_SEC(TIMEDIFF(LEAD(GPS_TIME, 1, null) OVER (ORDER BY GPS_TIME), GPS_TIME)) as Seconds_GPS_TIME
from a_track
where datediff(GPS_TIME, now()) = -1 and TRUCK_ID = '28734729376582836682378'
) a
where Seconds_GPS_TIME > 2400 [1]
这个查询将返回满足条件的结果集,其中时间差大于40分钟(40分钟等于2400秒)。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [MySQL统计GPS时间点相邻两个GPS时间点相差大于5分钟的数据](https://blog.csdn.net/weixin_54619899/article/details/124337453)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [MySQL查询条件常见用法详解](https://download.csdn.net/download/weixin_38562079/14836707)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文