PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, August 7, 2022

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

 August 07, 2022     decimal, mysql, unsigned     No comments   

Issue

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


Answered By - blabla_bingo
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing