Collections:
FORMAT_PICO_TIME() - Formatting Picoseconds in Readable Units
How to format a number of picoseconds in a human-readable unit using the FORMAT_PICO_TIME() function?
✍: FYIcenter.com
FORMAT_PICO_TIME(con) is a MySQL built-in function that
converts a number of picoseconds in a human-readable unit of ps, ns, ms,
s, min, h, or d.
For example:
SELECT FORMAT_PICO_TIME(9), FORMAT_PICO_TIME(9*1000), FORMAT_PICO_TIME(9*1000*1000); -- +---------------------+--------------------------+-------------------------------+ -- | FORMAT_PICO_TIME(9) | FORMAT_PICO_TIME(9*1000) | FORMAT_PICO_TIME(9*1000*1000) | -- +---------------------+--------------------------+-------------------------------+ -- | 9 ps | 9.00 ns | 9.00 us | -- +---------------------+--------------------------+-------------------------------+ SELECT FORMAT_PICO_TIME(9*POW(1000,3)), FORMAT_PICO_TIME(9*POW(1000,4)); -- +---------------------------------+---------------------------------+ -- | FORMAT_PICO_TIME(9*POW(1000,3)) | FORMAT_PICO_TIME(9*POW(1000,4)) | -- +---------------------------------+---------------------------------+ -- | 9.00 ms | 9.00 s | -- +---------------------------------+---------------------------------+ SELECT FORMAT_PICO_TIME(9*POW(1000,4)*60), FORMAT_PICO_TIME(9*POW(1000,4)*60*60); -- +------------------------------------+---------------------------------------+ -- | FORMAT_PICO_TIME(9*POW(1000,4)*60) | FORMAT_PICO_TIME(9*POW(1000,4)*60*60) | -- +------------------------------------+---------------------------------------+ -- | 9.00 min | 9.00 h | -- +------------------------------------+---------------------------------------+ SELECT FORMAT_PICO_TIME(9*POW(1000,4)*60*60*24); -- +------------------------------------------+ -- | FORMAT_PICO_TIME(9*POW(1000,4)*60*60*24) | -- +------------------------------------------+ -- | 9.00 d | -- +------------------------------------------+
Reference information of the FORMAT_PICO_TIME() function:
FORMAT_PICO_TIME(picoseconds): str Converts a number of picoseconds in a human-readable unit of ps, ns, ms, s, min, h, or d. Arguments, return value and availability: picoseconds: Required. The number of picoseconds to be converted. str: Return value. The converted number in a human-readable unit. Available since MySQL 8.0.
⇒ FROM_DAYS() - Converting Days to Date
⇐ EXTRACT() - Extracting Datetime Component
2025-09-24, 1180🔥, 0💬
Popular Posts:
What Happens If the Imported Table Already Exists in Oracle? If the import process tries to import a...
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS) in SQL Server? Process sqlservr.exe is the...
How to run Queries with SQL Server Management Studio Express in SQL Server? 1. Launch and connect SQ...
What Happens If the UPDATE Subquery Returns Multiple Rows in SQL Server? If a subquery is used in a ...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...