我想知道两个日期之间的时差。例如:
SELECT TIMEDIFF('2012-12-19 22:00:00','2012-12-10 19:00:00');
+-------------------------------------------------------+
| TIMEDIFF('2012-12-19 22:00:00','2012-12-10 19:00:00') |
+-------------------------------------------------------+
| 219:00:00 |
+-------------------------------------------------------+
1 row in set (0.00 sec)
现在我想提取时间。
mysql> SELECT HOUR(SELECT TIMEDIFF('2012-12-19 22:00:00','2012-12-10 19:00:00'));
ERROR 1064 (42000):
为什么不起作用?