TIMESTAMPDIFF returns the difference between two times as a multiple of the given interval:
mysql>
mysql> select TIMESTAMPDIFF(DAY, '2005-12-31', '2006-02-15');
+------------------------------------------------+
| TIMESTAMPDIFF(DAY, '2005-12-31', '2006-02-15') |
+------------------------------------------------+
| 46 |
+------------------------------------------------+
1 row in set (0.00 sec)
mysql>
mysql>
Related examples in the same category