表 test2
mysql> desc test2;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| a1 | varchar(20) | YES | MUL | NULL | |
| a2 | varchar(20) | YES | | NULL | |
| a3 | varchar(20) | YES | | NULL | |
| a4 | varchar(20) | YES | | NULL | |
| a5 | varchar(20) | YES | | NULL | |
| a6 | varchar(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+创建索引:mysql> create index inx_a on test2(a1);
Query OK, 3 rows affected (0.02 sec)
Records: 3 Duplicates: 0 Warnings: 0没有问题我在创建非聚集索引时用如下命令:
create nonclustered index id_a on test2(a2);报错:mysql> create nonclustered index id_a on test2(a2);
ERROR 1064 (42000): 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 'nonclustered index id_a on test2(a2)' at line 1
哪点写错了呀??谢谢回答!
mysql> desc test2;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| a1 | varchar(20) | YES | MUL | NULL | |
| a2 | varchar(20) | YES | | NULL | |
| a3 | varchar(20) | YES | | NULL | |
| a4 | varchar(20) | YES | | NULL | |
| a5 | varchar(20) | YES | | NULL | |
| a6 | varchar(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+创建索引:mysql> create index inx_a on test2(a1);
Query OK, 3 rows affected (0.02 sec)
Records: 3 Duplicates: 0 Warnings: 0没有问题我在创建非聚集索引时用如下命令:
create nonclustered index id_a on test2(a2);报错:mysql> create nonclustered index id_a on test2(a2);
ERROR 1064 (42000): 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 'nonclustered index id_a on test2(a2)' at line 1
哪点写错了呀??谢谢回答!
解决方案 »
- postgresSQL下游标相关问题
- MySQL Administrator的Stored Connection是什么的
- 请问show processlist 里面在什么情况下会出现sleep?
- ubuntu10.04 安装 mysql4.0 源码出错,提示gethostbyname_r的参数数量不对。
- mysql的union all问题
- mysql存储过程 字符连接
- 两表连接,用了outer join,还是会丢掉一条记录,为什么啊?
- MySql 升级后在PHP中遇到这样的问题。
- mysql 里面怎么让存储过程执行完后就删除掉?
- 红箭头指的线是做啥用的
- ■■■MYSQL的int型设为自动增量(auto_createment),满了怎么办?
- MySQL 组合键怎么写, 谢谢
INNODB,主键就是 聚集索引,你也无法修改
mysql索引分类:http://longxzq-126-com.javaeye.com/blog/591273