哪個標點字元可以用作 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