Add an incorrect date to a special table and show the result. : DATE « Date Time « SQL / MySQL






Add an incorrect date to a special table and show the result.

    
mysql>
mysql> CREATE TABLE INCORRECT_DATES (COLUMN1 DATE);
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO INCORRECT_DATES VALUES ('2004-13-12');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql>
mysql> SELECT COLUMN1
    -> FROM INCORRECT_DATES;
+------------+
| COLUMN1    |
+------------+
| 0000-00-00 |
+------------+
1 row in set (0.00 sec)

mysql>
mysql> drop table INCORRECT_DATES;
Query OK, 0 rows affected (0.00 sec)

mysql>

   
    
    
    
  








Related examples in the same category

1.Extract just the date: DATE()
2.Treating Dates or Times as Numbers
3.Synthesizing Dates or Times Using Formatting Functions
4.Synthesizing Dates or Times Using Component-Extraction Functions
5.Date-Based Sorting
6.Date-Based Summaries