MariaDB: SECOND Function
This MariaDB tutorial explains how to use the MariaDB SECOND function with syntax and examples.
Description
The MariaDB SECOND function returns the second portion of a date value.
Syntax
The syntax for the SECOND function in MariaDB is:
SECOND( date_value )
Parameters or Arguments
- date_value
- A time or datetime value from which to extract the seconds.
Note
Applies To
The SECOND function can be used in the following versions of MariaDB:
- MariaDB 10
Example
Let's look at some MariaDB SECOND function examples and explore how to use the SECOND function in MariaDB.
For example:
SELECT SECOND('2014-05-19 09:19:02.000004'); Result: 2 SELECT SECOND('2014-05-19 15:21:13'); Result: 13 SELECT SECOND('14:01:26'); Result: 26 SELECT SECOND('838:11:59'); Result: 59
This last SECOND example would display the second portion of the current system time (current system time is returned by the CURTIME function).
SELECT SECOND(CURTIME());
Advertisements