添加PRIMARY KEY索引时对此SQL代码的说明(Explanation of this SQL code in adding PRIMARY KEY index)
我看到了以下SQL代码。 我完全理解它。 但是没有得到的是代码中的66 。
CREATE TABLE `wordpress`.`campaign_queue` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT , PRIMARY KEY (`id`(66)) ) ENGINE = InnoDB;I saw the following SQL code. I perfectly understand it. But what am not getting is what the 66 in the code does.
CREATE TABLE `wordpress`.`campaign_queue` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT , PRIMARY KEY (`id`(66)) ) ENGINE = InnoDB;最满意答案
查询说明:它告诉MySQL在id列的前66个字母上创建子部分键* 。 这仅适用于字符串类型,因此除非将字段类型更改为String,否则查询将返回错误
Explanation of the query: it is telling MySQL to create a sub part key* on the first 66 letters of id column. This only works for string types, so that query will return an error unless you change the field type to String
更多推荐
发布评论