select TIMESTAMPDIFF(DAY,begindate,enddate)+1 from table1 转载于:https://www.cnblogs.com/modou/articles/5811869.html