6
我在我的數據庫中有一個時間字段,它的值是22:05從時間值減去分鐘
我想要減去5分鐘。當字段是日期時間我使用sub_date和工作正常,但我不能與時間領域,我得到一個警告,我不知道如何處理;
mysql> SELECT scheduleFinalTime FROM clientSchedule WHERE clientScheduleID = 3;
+-------------------+
| scheduleFinalTime |
+-------------------+
| 22:05:00 |
+-------------------+
1 row in set (0.00 sec)
mysql> SELECT date_sub(scheduleFinalTime, INTERVAL 5 MINUTE) FROM clientSchedule WHERE clientScheduleID = 3;
+------------------------------------------------+
| date_sub(scheduleFinalTime, INTERVAL 5 MINUTE) |
+------------------------------------------------+
| NULL |
+------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+------------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------------+
| Warning | 1264 | Out of range value for column 'scheduleFinalTime' at row 1 |
+---------+------+------------------------------------------------------------+
1 row in set (0.00 sec)
預先感謝您