A. sql date函數
日期/時間的格式化[字元串轉換為日期]
Oracle
SQL> SELECT
2 TO_DATE('2010.10.01', 'YYYY.MM.DD')
3 FROM
4 al;
TO_DATE('2
----------
2010.10.01
SQL Server
1> SELECT
2> CONVERT(DATETIME, '2012-01-02 09:06:18', 120)
3> go
-----------------------
2012-01-02 09:06:18.000
(1 行受影響)
MySQL
mysql> SELECT
-> STR_TO_DATE('2010~10~22 20.55.09',
-> '%Y~%m~%d %k.%i.%s' ) A;
+---------------------+
| A |
+---------------------+
| 2010-10-22 20:55:09 |
+---------------------+
1 row in set (0.00 sec)