gpt4 book ai didi

使用 BTREE 的 mysql

转载 作者:行者123 更新时间:2023-11-29 00:52:32 25 4
gpt4 key购买 nike

如何解决这个问题?
我的表结构:

CREATE TABLE IF NOT EXISTS `tbl_foster_network` (
`network_id` int(11) NOT NULL COMMENT 'Network ID',
`network_name` varchar(64) NOT NULL COMMENT 'Network Name',
`network_domain` varchar(45) NOT NULL COMMENT 'Network Domain',
`created_when` datetime NOT NULL COMMENT 'Created When',
`last_modified_by` int(11) NOT NULL COMMENT 'Last Modified By',
`last_modified_when` datetime NOT NULL COMMENT 'Last Modified When',
PRIMARY KEY (`network_id`),
UNIQUE KEY `network_domain` (`network_id`,`network_name`,`network_domain`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Network';

错误

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Network'' at line 16

最佳答案

索引类型(USING BTREE)必须在列列表之前:

UNIQUE KEY uq_network_domain USING BTREE (network_id,network_name,network_domain)

来自manual :

[CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]      [index_name] [index_type] (index_col_name,...)      [index_option] ...index_type:    USING {BTREE | HASH}

关于使用 BTREE 的 mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7776780/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com