Sunday, 15 July 2012

mysql - Positive integer data type(without 0) -



mysql - Positive integer data type(without 0) -

i need integer number bigger 0 (1-65535)

is there mysql type or attribute unsigned, without 0 values?

no there not. there 5 different types of integers (6 if include enum). closest can smallint(0-65535). http://dev.mysql.com/doc/refman/5.5/en/integer-types.html

tinyint 0-255 smallint 0-65525 mediumint 0-16777215 int 0-4294967295 bigint 0-18446744073709551615

these unsigned values of integers types.

as mentioned in comments, create little int , add together trigger check see if inserted 0.

mysql

No comments:

Post a Comment