Which punctuation character can be used as the delimiter between MySQL date parts?

MySQLMySQLi Database

In this matter, MySQL permits us to use a relaxed format to date. We can use any punctuation character between date parts as a delimiter. Some examples are as follows −

mysql> Select date ('2016/10/20');
+---------------------+
| date ('2016/10/20') |
+---------------------+
| 2016-10-20          |
+---------------------+
1 row in set (0.00 sec)

mysql> Select date('2016^10^20');
+--------------------+
| date('2016^10^20') |
+--------------------+
| 2016-10-20         |
+--------------------+
1 row in set (0.00 sec)

mysql> Select date ('2016@10@20');
+---------------------+
| date ('2016@10@20') |
+---------------------+
| 2016-10-20          |
+---------------------+
1 row in set (0.00 sec)

mysql> Select date ('2016+10+20');
+---------------------+
| date ('2016+10+20') |
+---------------------+
| 2016-10-20          |
+---------------------+
1 row in set (0.00 sec)
raja
Published on 19-Feb-2018 10:39:58
Advertisements