奇怪的1264超出范围错误

Tho*_*ind 2 mysql mysql-error-1264

在MySQL中运行一组插入语句时,我一直在获取Error Code: 1264. Out of range value for column 'x' at row 1。列类型设置为,float(10, 10)并且列范围内的值都在范围23.912 to 26.458之内。我完全不知道为什么会收到此错误。

Mar*_*c B 5

float(10,10) 表示存储10个小数位,整数部分不留空间。

0.1234567890将是有效的,因为那是10位小数,但1.234567890不是,因为您没有为1.

float(total digits, decimal places),并且是一个总和,不是integer places, decimal places

123.456789 = 9 digits total, 6 for decimals -> float(9, 6)
Run Code Online (Sandbox Code Playgroud)