Search code examples
mysqldecimalunsigned

What is the maximum value of unsigned DECIMAL(M, D) column?


I found a DECIMAL(5, 2) column supports a range of -999.99 to 999.99 in 12.22.2 DECIMAL Data Type Characteristics.

When the column is defined as UNSIGNED, what is the maximum value that the column supports? Is it still 999.99?


Solution

  • This probably took less time than your typing the question. Like P.Salmon said, there really should be something more deep behind this.

    create table td (d decimal(5,2) unsigned);
    insert td values(999.99);
    -- Query OK, 1 row affected (0.00 sec)
    insert td values(1000);
    -- ERROR 1264 (22003): Out of range value for column 'd' at row 1