

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I store ‘0000-00-00’ as a date in MySQL?
For storing the date like ‘0000-00-00’ in a column of MySQL table, we must have to set the SQL mode to ‘allow_invalid_date’. Following example will demonstrate it −
mysql> SET sql_mode = 'allow_invalid_dates'; Query OK, 0 rows affected, 1 warning (0.03 sec) mysql> Create table test_date(date_order date); Query OK, 0 rows affected (0.45 sec) mysql> Insert into test_date(date_order) values('0000-00-00'); Query OK, 1 row affected (0.04 sec) mysql> Select * from test_date; +------------+ | date_order | +------------+ | 0000-00-00 | +------------+ 1 row in set (0.00 sec)
- Related Questions & Answers
- Create MySQL datetime column with default 0000-00-00?
- MySQL query to order timestamp in descending order but place the timestamp 0000-00-00 00:00:00 first?
- MySQL query to select date from 00:00 to today’s date
- In which format Year(2) or Year(4) MySQL will return the value of year from date ‘0000-00-00’?
- Display hour in KK (00-11) format in Java
- Format hour in HH (00-23) format in Java
- Convert PHP variable “11:00 AM” to MySQL time format?
- How is it possible to store date such as February 30 in a MySQL date column?
- How do I format a number as decimal to store it in MySQL?
- How can I store the fixed length string as well as variable length string in the same MySQL table?
- Construct ∈-NFA of Regular Language L = (00)*1(11)*
- How MySQL evaluates if I store date along with time value in a column having DATE data type?
- Construct ∈-NFA of Regular Language L = (0+1)*(00+ 11)
- How can I display Java date as '12/04/2019'
- 8085 Program to alternately display 00 and FF in the data field
Advertisements