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.
如何合计两个日期的分钟数?我的意思是我想知道从 MySQL 到使用 MySQL 的总分钟2012-01-08 8:30数2012-01-09 14:11?
2012-01-08 8:30
2012-01-09 14:11
initiate_date我的表中有finalize_date列,我想选择它们并显示它们的总分钟数。
initiate_date
finalize_date
我建议时间戳差异
例如
TIMESTAMPDIFF(MINUTE, initiate_date, finalize_date)
SELECT (TIME_TO_SEC(end_time) - TIME_TO_SEC(start_time))/60 AS `minutes`