既为非负数,用此类型可以增加数据长度。
例如如果 tinyint最大是127,那 tinyint unsigned 最大 就可以到 127 * 2
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for test
-- ----------------------------
DROP TABLE IF EXISTS `test`;
CREATE TABLE `test` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`status` tinyint(3) default NULL,
`unsigned_status` tinyint(3) unsigned default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4294967295 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `test` VALUES ('1',128-1,128*2-1);