Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以在CREATE TABLE语句上创建索引吗? 即我可以在创建表时为表定义索引吗?我的意思是在 create stament sql 命令上创建索引
CREATE TABLE
是的,它可以在 中定义CREATE TABLE,约定是将这些定义放在列表的末尾。
CREATE TABLE `example` ( `id` INTEGER NOT NULL AUTO_INCREMENT, `index_col` VARCHAR(20), PRIMARY KEY (`id`), INDEX `index_name` (`index_col`) )