dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Intermediate
Oct 25, 2019

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Using MICROSECOND in MySQL

By default, developers work with time up to the level of seconds, i.e. HOURS, MINUTES and SECONDS. There could be instances in which we may want to work on the MICROSECOND level as well.

The example below illustrates the usage of MICROSECOND in TIME.

Query:

SELECT MICROSECOND(NOW(3));

Note: NOW takes an argument between 0 to 6 and the precision of the value is based on this argument.

Sample output:

+---------------------+
| MICROSECOND(NOW(3)) |
+---------------------+
|              176000 |
+---------------------+
M S Sridhar
 
Thanks for your registration, follow us on our social networks to keep up-to-date