Warning#1264:out of range error in mysql

前端 未结 2 2070
情歌与酒
情歌与酒 2020-12-10 13:59

The following query:

INSERT INTO skill (`emp_number`, `skill_id`, `year_exp`, `comments`)
VALUES (\'4\', \'3\', \'23.45\', \'\')

It is prod

2条回答
  •  难免孤独
    2020-12-10 14:36

    Change fieldtype to decimal(4,2). Details: https://dev.mysql.com/doc/refman/5.7/en/precision-math-decimal-characteristics.html

    The declaration syntax for a DECIMAL column is DECIMAL(M,D). The ranges of values for the arguments in MySQL 5.7 are as follows:

    M is the maximum number of digits (the precision). It has a range of 1 to 65.

    D is the number of digits to the right of the decimal point (the scale). It has a range of 0 to 30 and must be no larger than M.

提交回复
热议问题