最佳答案
超出范围
例如,DECIMAL(5,2)存储五位数和两位小数的任何值,其范围为-999.99到999.99.
@H_502_7@SELECT CAST(1 AS DECIMAL(5,4)) -> 1.0000
SELECT CAST(1 AS DECIMAL(4,3)) -> 1.000
SELECT CAST(0.0001 AS DECIMAL(4,4)) -> 0.0001
SELECT CAST(0.00001 AS DECIMAL(4,4)) -> 0.0000
SELECT CAST(12345 AS DECIMAL(5,4)) -> 9.9999
更多信息:
https://dev.mysql.com/doc/refman/5.7/en/precision-math-decimal-characteristics.html
https://dev.mysql.com/doc/refman/5.7/en/fixed-point-types.html