MySQL中BIGINT和BIGINT(20)之间的区别?
BIGINT和BIGINT(20)之间的唯一区别是显示宽度。20可用于显示宽度。
让我们看一个示例并创建一个表。在这里,我们设置了BIGINT(20)-
mysql> create table DemoTable ( Number bigint(20) zerofill );
使用插入命令在表中插入一些记录-
mysql> insert into DemoTable values(1); mysql> insert into DemoTable values(12); mysql> insert into DemoTable values(123); mysql> insert into DemoTable values(1234);
使用select语句显示表中的所有记录-
mysql> select *from DemoTable;
这将产生以下输出。现在的宽度为20,因此数字会扩展并可见,如下所示-
+----------------------+ | Number | +----------------------+ | 00000000000000000001 | | 00000000000000000012 | | 00000000000000000123 | | 00000000000000001234 | +----------------------+ 4 rows in set (0.00 sec)
热门推荐
10 新年门口花束祝福语简短
11 盘锦结婚祝福语大全简短
12 父母生日祝福语 简短独特
13 家庭恩爱祝福语简短英文
14 高考俄语祝福语大全简短
15 虎年祝福语 诗句唯美简短
16 生日婚礼祝福语简短精辟
17 虎年喝酒拜年祝福语简短
18 教师闺蜜祝福语简短