语法:timestampdiff(interval,start_time,end_time)
,返回end_time-start_time
差值。其中interval
参数可取SECOND
、 MINUTE
、 HOUR
、 DAY
、 WEEK
、 MONTH
、 QUARTER
或YEAR
select timestampdiff(MINUTE,'2020-01-02 23:34:55','2020-01-04 22:11:12') from dual
返回值:2796
计算两个时间之间的差值1.datediff()计算date差值2.timediff()计算时分秒差值3.timestampdiff()计算指定维度的时间差值1.datediff()计算date差值语法:datediff(end_time,start_time),返回end_time-start_time的日期差值select datediff('2020-01-04 22:11:12','2020-01-02 23:11:12') from dual返回值:22.timediff()计算时分秒差