May 2005
Intermediate to advanced
352 pages
14h 39m
English
TIMESTAMPADD( )
TIMESTAMPADD(interval,value,datetime)
This function adds the given interval
of time to the given date or time. The intervals accepted are
FRAC_SECOND, SECOND,
MINUTE, HOUR,
DAY, WEEK,
MONTH, QUARTER, and
YEAR. For compatibility with other systems, you
can add the SQL_TSI_ prefix to these interval
names (e.g., SQL_TSI_YEAR). This function is
available as of Version 5 of MySQL. This function is similar to
DATE_ADD( ). In this example, an appointment is
set to an hour later.
UPDATE appointments SET appointment = TIMESTAMPADD(HOUR, 1, appointment) WHERE rec_id = '8930';
Read now
Unlock full access