

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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.
- Related Questions & Answers
- How can we add day/s in the date stored in a column of MySQL table?
- Can we add a column to a table from another table in MySQL?
- How can we insert current date automatically in a column of MySQL table?
- How can we alter table to add MySQL stored GENERATED COLUMNS?
- Can we use INTERVAL keyword while inserting date records in a MySQL table?
- How can I use MySQL INTERVAL() function with a column of a table?
- How can we remove a column from MySQL table?
- How can we put comments in a column of existing MySQL table?
- How can we add values into the columns of a MySQL table?
- How to add a column in a table in MySQL?
- How can we find the index position of a string stored as a record in MySQL table’s column?
- How can we use MySQL EXPORT_SET() function with column of a table?
- How can we modify column/s of MySQL table?
- How can we create a MySQL one-time event that executes after some specified time interval?
- Add a single year to all the date records in a MySQL table column
Advertisements