用mysql的函数to_days()把日期转化成天数,再相减mysql> select to_days('2003-12-02');
+-----------------------+
| to_days('2003-12-02') |
+-----------------------+
| 731916 |
+-----------------------+
1 row in set (0.03 sec)mysql> select to_days('2003-12-05');
+-----------------------+
| to_days('2003-12-05') |
+-----------------------+
| 731919 |
+-----------------------+
1 row in set (0.00 sec)mysql>
+-----------------------+
| to_days('2003-12-02') |
+-----------------------+
| 731916 |
+-----------------------+
1 row in set (0.03 sec)mysql> select to_days('2003-12-05');
+-----------------------+
| to_days('2003-12-05') |
+-----------------------+
| 731919 |
+-----------------------+
1 row in set (0.00 sec)mysql>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货