mysql> SELECT ROUND(2.5), ROUND(25E-1);+------------+--------------+| ROUND(2.5) | ROUND(25E-1) |+------------+--------------+| 3 | 2 |+------------+--------------+
mysql> CREATE TABLE t (d DECIMAL(10,0));Query OK, 0 rows affected (0.00 sec)mysql> INSERT INTO t VALUES(2.5),(2.5E0);Query OK, 2 rows affected, 2 warnings (0.00 sec)Records: 2 Duplicates: 0 Warnings: 2mysql> SHOW WARNINGS;+-------+------+----------------------------------------+| Level | Code | Message |+-------+------+----------------------------------------+| Note | 1265 | Data truncated for column 'd' at row 1 || Note | 1265 | Data truncated for column 'd' at row 2 |+-------+------+----------------------------------------+2 rows in set (0.00 sec)mysql> SELECT d FROM t;+------+| d |+------+| 3 || 3 |+------+2 rows in set (0.00 sec)
文章转载自林员外聊编程,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




