MySQL Microsecond function is a Date Function, which is used to return the microseconds from the given time or DateTime expression.
In this article, we will show you, How to use this Microsecond function to get the Microseconds from date and time with an example.
MySQL Microsecond Syntax
The basic syntax of the Microsecond() Function in MySQL is as shown below:
MICROSECOND(DateTime or time expression);
MySQL Microsecond function Example
These examples helps you understand the use of this Microsecond function. Here, we are returning the Microseconds from the time expression, and the Date & time expression.
SELECT MICROSECOND('2019-02-14 10:12:22.223156');
From the above screenshot, MICROSECOND(’12:12:62.123160′); means, we are trying to get microsecond from an invalid date. That’s why, it returns NULL.
Thank You for Visiting Our Blog