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, 1367🔥, 0💬
Popular Posts:
Is SQL Server Transact-SQL case sensitive? No. Transact-SQL is not case sensitive. Like the standard...
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in SQL Server? Sometimes, y...
What Happens to Your Transactions When ERROR 1205 Occurred in MySQL? If your transaction receives th...
How To Convert Binary Strings into Integers in SQL Server Transact-SQL? Binary strings and integers ...
What Is Program Global Area (PGA) in Oracle? A Program Global Area (PGA) is a memory buffer that is ...