- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What MySQL returns if I use enclosed set of unit values with INTERVAL keyword?
In this case, MySQL will take into consideration the first value out of two provided in the enclosed set of unit values. It will return the output along with warning after calculating the interval, based on the considered value from an enclosed set, on the unit given in INTERVAL keyword.
The following example will clarify it −
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)
- Related Articles
- What MySQL returns if I write only one value in the enclosed set of unit values for compound INTERVAL unit?
- How can I use the arithmetic operators (+,-,*,/) with unit values of INTERVAL keyword in MySQL?
- How MySQL behaves if I use INTERVAL keyword with an invalid date?
- What are the different unit values that can be used with MySQL INTERVAL keyword?
- How can I use INTERVAL keyword with MySQL NOW() and CURDATE() functions?
- How can I use MySQL INTERVAL keyword while extracting the part of the date?
- What MySQL returns if the first argument of INTERVAL() function is NULL?
- How to use compound INTERVAL unit in MySQL?
- How MySQL behaves when we use INTERVAL of time unit with CURDATE() function?
- What MySQL returns if we use UNIX_TIMESTAMP() function with no argument?
- What MySQL returns if sub-query, used to assign new values in the SET clause of UPDATE statement, returns no rows?
- What MySQL returns if sub-query, used to assign new values in the SET clause of UPDATE statement, returns multiple rows?
- What MySQL returns if I do not use the keyword ‘RIGHT’ or ‘LEFT’ while writing the query for RIGHT JOIN or LEFT JOIN?
- What MySQL returns when we use DISTINCT clause with the column having multiple NULL values?
- What MySQL returns if I insert invalid value into ENUM?

Advertisements