哪个标点字符可以用作 MySQL 时间部分之间的分隔符?
就像日期值的情况下,MySQL 也允许我们为时间使用放松的格式。我们可以在时间部分之间使用任何标点字符作为分隔符。以下是一些示例 -
mysql> Select timestamp('2017-10-20 04+05+36');
+----------------------------------+
| timestamp('2017-10-20 04+05+36') |
+----------------------------------+
| 2017-10-20 04:05:36 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> Select timestamp('2017-10-20 04*05*36');
+----------------------------------+
| timestamp('2017-10-20 04*05*36') |
+----------------------------------+
| 2017-10-20 04:05:36 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> Select timestamp('2017-10&20 04@05+36');
+----------------------------------+
| timestamp('2017-10&20 04@05+36') |
+----------------------------------+
| 2017-10-20 04:05:36 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> Select timestamp('2017*10@20 04*05*36');
+----------------------------------+
| timestamp('2017*10@20 04*05*36') |
+----------------------------------+
| 2017-10-20 04:05:36 |
+----------------------------------+
1 row in set (0.00 sec)
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP