12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-11-26 22:09:54
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
mysql 自定义分析函数 least 及 日期函数为项目需要,由于mysql不提供分析函数least ,自己写了一个.供大家参考.SELECT filename,uarfcn,cpi,dateTime,str_to_date(dateTime,
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
mysql 自定义分析函数 least 及 日期函数
为项目需要,由于mysql不提供分析函数least ,自己写了一个.供大家参考.
SELECT filename,
uarfcn,
cpi,
dateTime,
str_to_date(dateTime, '%H:%i:%s.%f'),
(select dateTime
from tdoas_scantest_cellerr tt
where tt.filename = t.filename
and tt.uarfcn = t.uarfcn
and tt.cpi = t.cpi
and tt.id > t.id
order by id limit 1) cc,
time_to_sec(timediff(str_to_date(dateTime, '%H:%i:%s.%f'),
(str_to_date((select dateTime
from tdoas_scantest_cellerr tt
where tt.filename = t.filename
and tt.uarfcn = t.uarfcn
and tt.cpi = t.cpi
and tt.id > t.id
order by id limit 1),
'%H:%i:%s.%f')))) cc2
from tdoas_scantest_cellerr t
where filename = '0702-主干道珞瑜路-4-122K-3[1].SCL.txt'
and cpi = 53
and uarfcn = 10055
order by id
[@more@]
另附上部分日期函数
str_to_date :将字符转日期
timediff :取两个日期的差值
time_to_sec :将日期转为秒
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19