This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-21. For the latest, interactive version please visit https://mariadb.com/kb/.

TIME

Sintassi

TIME [(<precisione in microsecondi>)]

La precisione in microsecondi può essere da 0 a 6; se non è specificata sarà 0. I microsecondi sono supportati da MariaDB 5.3.

Spiegazione

Un orario. I valori ammessi vanno da '-838:59:59.999999' a '838:59:59.999999'. MariaDB mostra i valori TIME nel formato 'HH:MM:SS.ssssss', ma permette di assegnare valori alle colonne di tipo TIME utilizzando sia i numeri sia le stringhe.

Esempi

MariaDB [test]> CREATE TABLE time (t TIME);
Query OK, 0 rows affected (0.27 sec)

MariaDB [test]> INSERT INTO time VALUES ('90:00:00'),('800:00:00');
Query OK, 2 rows affected (0.23 sec)
Records: 2  Duplicates: 0  Warnings: 0

MariaDB [test]> INSERT INTO time VALUES (800);
Query OK, 1 row affected (0.12 sec)

MariaDB [test]> SELECT * FROM time;
+-----------+
| t         |
+-----------+
| 90:00:00  |
| 800:00:00 |
| 00:08:00  |
+-----------+
3 rows in set (0.00 sec)

MariaDB [test]> 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.