📜  mysql timediff - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:29.803000             🧑  作者: Mango

代码示例1
SET @date1 = '2010-10-11 00:00:00', @date2 = '2010-10-10 00:00:00';
SELECT 
  TIMEDIFF(@date1, @date2) AS 'TIMEDIFF',
  TIMESTAMPDIFF(hour, @date1, @date2) AS 'TIMESTAMPDIFF';