我如何计算两个日期之间的差异,以使查询与:MySql,H2和SqlServer兼容?
DATEDIFF
function that returns difference in specified DATEPART
SELECT DATEDIFF(dd,'1/20/2014,'1/22/2014')
http://technet.microsoft.com/en-us/library/ms189794.aspx
DATEDIFF()
just a little bit differently, SELECT DATEDIFF('2008-11-30','2008-11-29') AS DiffDate
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_datediff
DATEDIFF
DATEDIFF('YEAR', T1.CREATED, T2.CREATED)
在SQL Server中-
datediff (day,startdate,enddate)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.