sql data_add()函数

语法

DATE_ADD(date,INTERVAL expr type) 将日期ate增加一定的时间间隔expr

type 参数可以是下列值:

Type 值
MICROSECOND
SECOND
MINUTE
HOUR
DAY
WEEK
MONTH
QUARTER
YEAR
SECOND_MICROSECOND
MINUTE_MICROSECOND
MINUTE_SECOND
HOUR_MICROSECOND
HOUR_SECOND
HOUR_MINUTE
DAY_MICROSECOND
DAY_SECOND
DAY_MINUTE
DAY_HOUR
YEAR_MONTH


例如,下表记为Table1

Name Date
‘Clothe' 2008-12-29
sql语句:

SELECT DATE_ADD(Date,INTERVAL 2 DAY) From Table1  

结果为:2008-12-31

你可能感兴趣的:(sql data_add()函数)