MySQL Tutorial/Date Time Functions/MICROSECOND

Материал из SQL эксперт
Перейти к: навигация, поиск

MICROSECOND(expr) returns the microseconds as a number in the range from 0 to 999999.

mysql>
mysql> SELECT MICROSECOND("12:00:00.123456");
+--------------------------------+
| MICROSECOND("12:00:00.123456") |
+--------------------------------+
|                         123456 |
+--------------------------------+
1 row in set (0.00 sec)
mysql>


SELECT MICROSECOND("1997-59:59.000010");

mysql>
mysql> SELECT MICROSECOND("1997-12-31 23:59:59.000010");
+-------------------------------------------+
| MICROSECOND("1997-12-31 23:59:59.000010") |
+-------------------------------------------+
|                                        10 |
+-------------------------------------------+
1 row in set (0.00 sec)
mysql>