In MySQL, SECOND_MICROSECOND is one of several composite interval units that combine two temporal parts—in this case seconds and microseconds. It is used in conjunction with the INTERVAL keyword inside functions such as DATE_ADD, DATE_SUB, ADDDATE, SUBDATE, TIMESTAMPADD, and TIMESTAMPDIFF. The interval value may be supplied as either a numeric literal or a string literal. When numeric, the portion before the decimal point denotes seconds while the fractional part denotes microseconds. When a string literal is used, it must follow the format 'SSSSSS.MICROS', where SSSSSS is a zero-padded second value (0-59) and MICROS is a six-digit microsecond value (000000-999999).MySQL stores microseconds in the range 0-999999. If a supplied value contains more than six fractional digits, it is rounded. If the value is outside valid ranges a warning or error is thrown, depending on SQL mode. SECOND_MICROSECOND cannot be used alone in DDL statements; it is only meaningful inside date-time arithmetic expressions.
expr
(DECIMAL or STRING) - Number of seconds and microseconds to add, subtract, or compare. Format examples: 1.500000, 60.000001, '01.000123'.MySQL 4.1
A numeric literal uses the part before the decimal for seconds and the six-digit fractional part for microseconds (e.g., 2.750000 means 2 seconds 750000 microseconds).
Yes. Supply a string like '02.750000'. MySQL converts it to the correct internal representation.
Values with more than six fractional digits are rounded to the nearest microsecond.
Use TIMESTAMPDIFF(SECOND_MICROSECOND, earlier, later). The result is the total number of microseconds between the two values.