'CREATE TABLE `test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`price` float(7,6) DEFAULT NULL,
PRIMARY KEY (`id`)
) ;
insert into test(price) values (535.566);提示out of range !!!不是说7个整数,6个小数吗?你看我的是什么东西?535.566!!!! 怎么就无法插入嗯?
`id` int(11) NOT NULL AUTO_INCREMENT,
`price` float(7,6) DEFAULT NULL,
PRIMARY KEY (`id`)
) ;
insert into test(price) values (535.566);提示out of range !!!不是说7个整数,6个小数吗?你看我的是什么东西?535.566!!!! 怎么就无法插入嗯?
解决方案 »
- 如何选择合适的mysql安装包?
- 这条mysql语句explain看起来已经很优化的了,但是执行起来要十几秒
- Streaming result set com.mysql.jdbc.RowDataDynamic@5bdbda4f 求解
- mysql 怎么导入/导出2个关联表中的数据
- 用mysql的 sql 语句 找出 id 最后面100条 里 不连续的 最开始的id
- mysql数据库能转换为SQL Server 数据库吗?可以的话,用什么方法?
- 这个sql语句如何实现?
- 请问有什么好的mysql服务器程序下载?
- mysql中怎么随机生成1000条不重复的数据
- MySQL 假删除重复数据,只保留一条数据?
- mysql语句,哪个高效?
- 能不能在查询的同时,改变另一个字段的值?
D is the number of digits following the decimal point
所以整数部分就是7-6=1位
`id` int(11) NOT NULL AUTO_INCREMENT,
`price` float(12,4) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8'
alter table test alter column price decimal(13,6); //error ,这是一行代码,我在mysql 的gui里面执行的
...........alter table test alter column price decimal(13,6); //error ,这是一行代码,我在mysql 的gui里面执行的
[/code]错误提示是什么? 提问时请一同贴出错误提示及它信息以便他人分析。
问题说明越详细,回答也会越准确!参见如何提问。(提问的智慧)
...........alter table test alter column price decimal(13,6); //error ,这是一行代码,我在mysql 的gui里面执行的
[/code]错误提示是什么? 提问时请一同贴出错误提示及它信息以便他人分析。
问题说明越详细,回答也会越准确!参见如何提问。(提问的智慧)
error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal(13,6)' at line 1
测试了一下,应该是不包括小数点的。但是float(m,n)小数点后面n位,整数不封m-n,小数点后面不足会自动补充
测试了一下,应该是不包括小数点的。但是float(m,n)小数点后面n位,整数不封m-n,小数点后面不足会自动补充在不?什么叫 整数不封m-n?看不懂,求解释