Home > Database > Mysql Tutorial > body text

mysql中ADDDATE函数用法_MySQL

WBOY
Release: 2016-06-01 13:44:49
Original
1625 people have browsed it

bitsCN.com

ADDDATE(date,INTERVAL expr type) ADDDATE(expr,days)
当被第二个参数的INTERVAL 格式激活后, ADDDATE() 就是DATE_ADD() 的同义词。相关函数SUBDATE() 则是DATE_SUB() 的同义词。对于INTERVAL 参数上的信息 ,请参见关于DATE_ADD() 的论述。
mysql> SELECT DATE_ADD('1998-01-02', INTERVAL 31 DAY);
        -> '1998-02-02'
mysql> SELECT ADDDATE('1998-01-02', INTERVAL 31 DAY);
        -> '1998-02-02'
若 days 参数只是整数值,则 MySQL 5.1 将其作为天数值添加至 expr 。
mysql> SELECT ADDDATE('1998-01-02', 31);
        -> '1998-02-02'

作者“程序员的杯具--你懂的!”
 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template