![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
How can we add a time interval to date stored in a column of MySQL table?
MySQL ADDTIME() function can be used to add a time interval in the data stored in a column of the table. The syntax of this function is ADDTIME(date, ‘expression unit’). It can be demonstrated by following the example which uses the data from table ‘collegedetail’.
mysql> Select estb, ADDTIME(estb, '05:04:25')AS 'Date with time' From collegedetail WHERE ID = 111; +------------+---------------------+ | estb | Date with time | +------------+---------------------+ | 2010-05-01 | 2010-05-01 05:04:25 | +------------+---------------------+ 1 row in set (0.02 sec)
Here, ‘estb’ is a column of table ‘collegedetail’ having the date as values.
Advertisements