要在MySQL中实现DOUBLE,语法如下-create table yourTableName
(
yourColumnName double(5,2) unsigned
);
让我们首先创建一个表-mysql> create table DemoTable1814
(
Amount double(5,2) unsigned
);
使用插入命令在表中插入一些记录-mysql> insert into DemoTable1814 values(1.98);
mysql> insert into DemoTable1814 values(100.24);
mysql> insert into DemoTable1814 values(198.50);
使用select语句显示表中的所有记录-mysql> select * from DemoTable1814;
这将产生以下输出-+--------+
| Amount |
+--------+
| 1.98 |
| 100.24 |
| 198.50 |
+--------+
3 rows in set (0.00 sec)