#日期相差:datadiff,两个参数为时间类型 SELECT DATEDIFF('2019-2-28','2019-2-2'); SELECT DATEDIFF(MAX(hiredate),MIN(hiredate)) AS difference FROM employees; SELECT DATEDIFF(NOW(),'2012-12-2') ;来源:51CTO作者:wx5d21d5e6e5ab1链接:https://blog.51cto.com/14437184/2436577 标签 mysql mysql日期函数 select函数 mysql时间函数