Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图弄清楚如何找到多个不同时间值的平均值,时间值是与 2 个日期的时间差,因此它们的格式为hh:mm:ss. 因此,如果我有 4 个时间值:
hh:mm:ss
00:11:05 00:01:30 00:04:25 00:09:50
我很难弄清楚这一点。 我认为这些时间值需要转换为某种类型的整数值,然后除以再转换回这种时间格式。
任何帮助表示赞赏。
谢谢
SELECT DATE_FORMAT( FROM_UNIXTIME( AVG( UNIX_TIMESTAMP(CONCAT('1980-01-01 ',timefield)) ) ), '%H:%i:%s.%f') FROM times;