数据库查询,怎么计算某两条的时间间隔,求大神

数据库查询,怎么计算某两条的时间间隔,求大神,第1张

select cont_1, sum(case cont_2 when 1 then -1*time else time end) total_time from

(

select id, content, substring(content, 2, 4) cont_1, substring(content, 8, 1) cont_2, unix_timestamp(time) time from t_aaa

where content like '[%],%'

) tmp

group by cont_1

出来的结果(单位:秒):

1001120

200131

你不是有id这一项吗,那你可直接指定id的范围啊,也就是

SELECT * FROM t WHERE (id >10 and id <16 ) or (id>61 and id <65)


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/9963499.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-03
下一篇 2023-05-03

发表评论

登录后才能评论

评论列表(0条)

保存