double(16,4) 小数点后4位, 总共16位小数 mysql> select * from test100; +--------------------+ | value | +--------------------+ | -1.0000 | | -1.0000 | | -1.0000 | | -99999999.0000 | | -123456789012.0000 | | 123456789012.0000 | +--------------------+ 6 rows in set (0.00 sec) bigint(20) unsigned unsigned 表示无符号: mysql> create table test200(value bigint(20) unsigned ); Query OK, 0 rows affected (0.01 sec) mysql> desc test200; +-------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------------+------+-----+---------+-------+ | value | bigint(20) unsigned | YES | | NULL | | +-------+---------------------+------+-----+---------+-------+ 1 row in set (0.01 sec) mysql> insert into test200 values(-1); ERROR 1264 (22003): Out of range value for column 'value' at row 1 mysql> desc test300; +-------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+------------+------+-----+---------+-------+ | value | bigint(20) | YES | | NULL | | +-------+------------+------+-----+---------+-------+ 1 row in set (0.00 sec) mysql> insert into test300 values(-1); Query OK, 1 row affected (0.00 sec) mysql> select * from test300; +-------+ | value | +-------+ | -1 | +-------+ 1 row in set (0.00 sec) mysql> desc history_uint; +--------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+---------------------+------+-----+---------+-------+ | itemid | bigint(20) unsigned | NO | MUL | NULL | | | clock | int(11) | NO | | 0 | | | value | bigint(20) unsigned | NO | | 0 | | | ns | int(11) | NO | | 0 | | +--------+---------------------+------+-----+---------+-------+ 4 rows in set (0.00 sec) mysql> desc history_uint; +--------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+---------------------+------+-----+---------+-------+ | itemid | bigint(20) unsigned | NO | MUL | NULL | | | clock | int(11) | NO | | 0 | | | value | bigint(20) unsigned | NO | | 0 | | | ns | int(11) | NO | | 0 | | +--------+---------------------+------+-----+---------+-------+ 4 rows in set (0.00 sec) mysql> alter table history_uint modify column value bigint(20); Query OK, 2952022 rows affected (52.83 sec) Records: 2952022 Duplicates: 0 Warnings: 0