In this case, MySQL will consider the first of the two values provided in the accompanying unit value set. It returns output, along with warnings, after calculating the interval based on the values considered in the closed set, in the units given in the INTERVAL keyword.
The following examples will clarify this -
mysql> Select TIMESTAMP('2017-10-22 04:05:36' + INTERVAL '4 2' Hour)AS 'HOUR VALUE INCREASED BY 4'; +---------------------------+ | HOUR VALUE INCREASED BY 4 | +---------------------------+ | 2017-10-22 08:05:36 | +---------------------------+ 1 row in set, 1 warning (0.00 sec) mysql> Show warnings; +---------+------+------------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------------+ | Warning | 1292 | Truncated incorrect INTEGER value: '4 2' | +---------+------+------------------------------------------+ 1 row in set (0.00 sec)
The above is the detailed content of What will MySQL return if I use a closed unit value set with the INTERVAL keyword?. For more information, please follow other related articles on the PHP Chinese website!