MySQL BigInt zerofill vs int zerofill?
MySQLBigInt和int之间的区别在于INT是32位长,而BIGINT是64位长。
以下是一些要点-
BigInt占用8个字节的存储空间,而int占用4个字节的存储空间。
int(10)的int取4294967295个最大值,而bigint(20)取18,446,744,073,709,551,615。
BigInt(20)和int(10),在这20和10中可用于带零填充的宽度显示。
这是Bigint和int与zerofill的演示。以下是创建表的查询。
mysql> create table BigintandintDemo −> ( −> Number1 bigint zerofill, −> Number2 int zerofill −> );
现在您可以在表中插入记录。查询如下-
mysql> insert into BigintandintDemo values(234556667777,678999);
在select语句的帮助下显示表中的所有记录。查询如下-
mysql> select *from BigintandintDemo;
以下是输出-
+----------------------+------------+ | Number1 | Number2 | +----------------------+------------+ | 00000000234556667777 | 0000678999 | +----------------------+------------+ 1 row in set (0.00 sec)