Collections:
Writing Date and Time Literals in MySQL
How To Write Date and Time Literals in MySQL?
✍: FYIcenter.com
MySQL offers a number of formats for you to use to enter date and time literals:
The tutorial exercise below gives you some good examples:
SELECT DATE('1997-01-31') FROM DUAL; 1997-01-31 SELECT DATE('1997-01-31 09:26:50') FROM DUAL; 1997-01-31 SELECT TIME('1997-01-31 09:26:50') FROM DUAL; 09:26:50 SELECT DATE('1997/01/31 09^26^50') FROM DUAL; 1997-01-31 SELECT TIME('1997/01/31 09^26^50') FROM DUAL; 09:26:50 SELECT DATE('19970131') FROM DUAL; 1997-01-31 SELECT TIME('092650') FROM DUAL; 09:26:50 SELECT DATE(19970131) FROM DUAL; -- Crazy format 1997-01-31 SELECT TIME(092650) FROM DUAL; -- Crazy format 09:26:50
⇒ Entering Microseconds in SQL Statements in MySQL
⇐ What are Date and Time Data Types in MySQL
2017-12-26, 1339🔥, 0💬
Popular Posts:
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...
What Is ISAM in MySQL? ISAM (Indexed Sequential Access Method) was developed by IBM to store and ret...
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...
What Are Out-of-Range Errors with DATETIME values in SQL Server Transact-SQL? When you enter DATETIM...