日期:2014-05-16 浏览次数:20990 次
mysql> set @ti := "09:30:00"; Query OK, 0 rows affected (0.00 sec) mysql> select time_format(@ti, "%h%i"); +--------------------------+ | time_format(@ti, "%h%i") | +--------------------------+ | 0930 | +--------------------------+ 1 row in set (0.00 sec) mysql> select replace(left(@ti, 5), ":", ""); +--------------------------------+ | replace(left(@ti, 5), ":", "") | +--------------------------------+ | 0930 | +--------------------------------+ 1 row in set (0.00 sec)