Home > Database > Mysql Tutorial > body text

mysql 相同id 相邻行的时间差

WBOY
Release: 2016-06-06 09:42:41
Original
1206 people have browsed it

mysql

图片说明
是这样的,那张表里面,id 不是唯一的,例如:1,1,1,1,2,2,2,3,4、、、现在问题是:比如id为1的,4条记录,其中前面3条是连续的(正常的是一个开始时间,一个结束时间),后面一条是独立的(即不连续的)但是现在由于截取了某个时间段把前面3条分别作了3条记录,现在需要把这3条合并一条,时长也合并,另外id为2的,3条都不连续的,那么这3条不作处理,id为3,4的也一样 ,图片id与文字ID不对应,但大概是这样的,需要把时间连续的拼接一下,但id是不同的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!