当前位置:Gxlcms > 数据库问题 > mysql numberic types ---- mysql 数值类型-简介

mysql numberic types ---- mysql 数值类型-简介

时间:2021-07-01 10:21:17 帮助过:20人阅读

create table t(x bit); Query OK, 0 rows affected (0.00 sec) mysql> insert into t(x) values(b0); Query OK, 1 row affected (0.00 sec) mysql> insert into t(x) values(b1); Query OK, 1 row affected (0.00 sec) mysql> select bin(x) from t; +--------+ | bin(x) | +--------+ | 0 | | 1 | +--------+ 2 rows in set (0.00 sec) -- 由于M默认是1、所以插入b‘11‘是超出范围了 mysql> insert into t(x) values(b11); ERROR 1406 (22001): Data too long for column x at row 1

  2、tinyint[(m)] [unsigned] [zerofill] 非常小的整数、它只占一个字节的存储空间、取值范围在[-128,127]

  3、bool,boolean 它是tinyint(1)的别名、0表示false 非0表示true

  4、smallint[(m)]  [unsigned] [zerofill] 小的整数、它只占两个字节的存储空间

  5、mediumint[(m)] [unsigned] [zerofill] 它只占三个字节的存储空间

  6、int[(m)] [unsigned] [zerofill] 整数占四个字节的存储空间

  7、bigint[(m)] [unsigned] [zerofill] 大整数占八个字节的存储空间

  8、serial 

 

 

 

----

mysql numberic types ---- mysql 数值类型-简介

标签:mysql   空间   div   --   别名   logs   值类型   表示   类型   

人气教程排行