MySQL 如何在MySQL表的存储日期的列中添加时间间隔?
MySQL ADDTIME()函数可用于在表的列中存储的数据中添加时间间隔。这个函数的语法是 ADDTIME(date,’expression unit’)。可以通过以下示例来演示它,它使用来自表 ‘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)
在这里,’estb’是表’collegedetail’的一列,其值为日期。
阅读更多:MySQL 教程