Collections:
Extract Unit Values from a Date and Time in MySQL
How To Extract a Unit Value from a Date and Time in MySQL?
✍: FYIcenter.com
If you want to extract a specific date or time unit value out of a date or a time, you can use the EXTRACT(unit FROM expression) function. The tutorial exercise below gives you some good examples:
ELECT EXTRACT(DAY FROM NOW()) FROM DUAL; 28 ELECT EXTRACT(HOUR FROM NOW()) FROM DUAL; 23 ELECT EXTRACT(SECOND FROM NOW()) FROM DUAL; 36
⇒ Date and Time Functions in MySQL
⇐ Presenting a Past Time in Hours, Minutes and Seconds in MySQL
2018-03-13, 1229👍, 0💬
Popular Posts:
How To Get the Definition of a User Defined Function Back in SQL Server Transact-SQL? If you want ge...
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns...
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
How to change the data type of an existing column with "ALTER TABLE" statements in SQL Server? Somet...