This tutorial explains how to use the MySQL MICROSECOND function with syntax and examples.
The MySQL MICROSECOND function returns the microsecond portion of a date value.
The syntax for the MICROSECOND function in MySQL is:
MICROSECOND( date_value )
The time or datetime value from which the microseconds are extracted from.
The MICROSECOND function can be used in the following versions of MySQL:
Let's look at some MySQL MICROSECOND function examples and explore how to use the MICROSECOND function in MySQL.
For example:
mysql> SELECT MICROSECOND('2014-01-28 15:21:05.000001');
Output: 1
mysql> SELECT MICROSECOND('2014-01-28 15:21:05.999999');
Output: 999999
mysql> SELECT MICROSECOND('2014-02-15');
Output: 0
mysql> SELECT MICROSECOND('12:13:06.387483');
Output: 387483
mysql> SELECT MICROSECOND('838:11:59.000013');
Output: 13