MySQL DATEDIFF() 函数
SQL 教程
· 2019-03-04 13:29:32
定义和用法
DATEDIFF() 函数返回两个日期之间的天数。
语法
DATEDIFF(date1,date2)
date1 和 date2 参数是合法的日期或日期/时间表达式。
注释:只有值的日期部分参与计算。
实例
下面是 SELECT 语句:
SELECT DATEDIFF('2008-11-30','2008-11-29') AS DiffDate
结果如下所示:
| DiffDate |
|---|
| 1 |
实例
下面是 SELECT 语句:
SELECT DATEDIFF('2008-11-29','2008-11-30') AS DiffDate
结果如下所示:
| DiffDate |
|---|
| -1 |
点击查看所有 SQL 教程 文章: https://codercto.com/courses/l/29.html
How to Design Programs, 2nd Edition
Matthias Felleisen、Robert Bruce Findler、Matthew Flatt、Shriram Krishnamurthi / MIT Press / 2018-5-4 / USD 57.00
A completely revised edition, offering new design recipes for interactive programs and support for images as plain values, testing, event-driven programming, and even distributed programming. This ......一起来看看 《How to Design Programs, 2nd Edition》 这本书的介绍吧!