MySQLint(4)类型的值范围是多少呢?
mysql> create table t1 (a int(4));
谓语动词
Query OK, 0 rows affected (0.14 c)
在线英汉翻译器mysql> inrt into t1 values(15652);mers怎么读
Query OK, 1 row affected (0.06 c)
mysql> inrt into t1 values(156522);
Query OK, 1 row affected (0.05 c)
mysql> inrt into t1 values(156********);
retreatERROR 1264 (22003): Out of range value adjusted for column 'a' at row 1
mysql> inrt into t1 values(1565222);
Query OK, 1 row affected (0.06 c)
mysql> inrt into t1 values(15652222);
moutain topQuery OK, 1 row affected (0.08 c)
mysql> inrt into t1 values(156522222);
Query OK, 1 row affected (0.05 c)
打电话推销技巧
三年级英语教学计划mysql> inrt into t1 values(1565222222);
Query OK, 1 row affected (0.03 c)
autumn是什么意思中文
mysql> inrt into t1 values(1565222222)2;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL rver version for the right syntax to u near '2' at
line 1
ipu
mysql>
展会翻译
为什么int(4)类型的字段可以插⼊9位的数字呢?
int(n)中不论n指定为多少,范围都⼀样-2~31~2^31-1,都能插⼊9位数字。n只是⽤来控制显⽰⽽已,如果为
int(4),插⼊⼀个1,显⽰时也会⽤空格补齐到4个字节
请问所有mysql中的数据类型中的(n)都是表⽰显⽰位数吗?
并⾮如此,NUMERIC(4)就限定了取值范围,超过4位就不允许写⼊了。因此如果你想限定数字的取值范
围,最好是⽤NUMERIC来定义。