For inserts into a DECIMAL or integer column : Decimal « Data Types « MySQL Tutorial






mysql>
mysql>
mysql> CREATE TABLE t (d DECIMAL(10,0));
Query OK, 0 rows affected (0.01 sec)

mysql>
mysql> INSERT INTO t VALUES(2.5),(2.5E0);
Query OK, 2 rows affected, 2 warnings (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 2

mysql> SELECT d FROM t;
+------+
| d    |
+------+
|    3 |
|    3 |
+------+
2 rows in set (0.00 sec)

mysql>
mysql> drop table t;
Query OK, 0 rows affected (0.01 sec)

mysql>








10.8.Decimal
10.8.1.DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]
10.8.2.DECIMAL(7,2)
10.8.3.For inserts into a DECIMAL or integer column