INTERVAL value Type : INTERVAL : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » INTERVAL »

 

INTERVAL value Type


Adds the value to the date argument. The word INTERVAL is a keyword and must be used in the function. The Type can be one of the types shown in Table B.1.

Type Expected Value
SECOND SECONDS
MINUTE MINUTES
HOUR HOURS
DAY DAYS
MONTH MONTHS
YEAR YEARS
MINUTE_SECOND "MINUTES:SECONDS"
HOUR_MINUTE "HOURS:MINUTES"
DAY_HOUR "DAYS HOURS"
YEAR_MONTH "YEARS-MONTHS"
HOUR_SECOND "HOURS:MINUTES:SECONDS"
DAY_MINUTE "DAYS HOURS:MINUTES"
DAY_SECOND "DAYS HOURS:MINUTES:SECONDS"


If you use one of the types in the first column, the value must match the format in the second column. See DATE_SUB().

SELECT DATE_ADD("2000-01-27", INTERVAL DAY)
SELECT DATE_ADD("2000-04-23 23:59:59", INTERVAL "1:1" MINUTE_SECOND)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» INTERVAL