CREATE INDEX vs ALTER TABLE ADD INDEX – MySQLism还是SQL Sta
刚遇到一个奇怪的问题,根据我创建索引的方式,需要索引名称.
http://dev.mysql.com/doc/refman/5.5/en/create-index.html http://dev.mysql.com/doc/refman/5.5/en/alter-table.html CREATE INDEX `random_name` ON `my_table` (`my_column`); # Requires an index name ALTER TABLE `my_table` ADD INDEX (`my_column`); # Does not require an index name 在我看来,CREATE INDEX调用,不应该使索引名称成为必需.我想知道这是MySQLism还是SQL标准? 解决方法我认为SQL标准根本??不定义如何创建索引.来自this Wikipedia page的报价:
The Postgres manual seems to support this here:
More evidence under this related question on SO. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |