<legend id='lm8eN'><style id='lm8eN'><dir id='lm8eN'><q id='lm8eN'></q></dir></style></legend>
      <i id='lm8eN'><tr id='lm8eN'><dt id='lm8eN'><q id='lm8eN'><span id='lm8eN'><b id='lm8eN'><form id='lm8eN'><ins id='lm8eN'></ins><ul id='lm8eN'></ul><sub id='lm8eN'></sub></form><legend id='lm8eN'></legend><bdo id='lm8eN'><pre id='lm8eN'><center id='lm8eN'></center></pre></bdo></b><th id='lm8eN'></th></span></q></dt></tr></i><div id='lm8eN'><tfoot id='lm8eN'></tfoot><dl id='lm8eN'><fieldset id='lm8eN'></fieldset></dl></div>
      • <bdo id='lm8eN'></bdo><ul id='lm8eN'></ul>

      <tfoot id='lm8eN'></tfoot>
    1. <small id='lm8eN'></small><noframes id='lm8eN'>

      在 MySQL 中使用 INDEX 和 KEY 有什么区别?

      What#39;s the difference between using INDEX vs KEY in MySQL?(在 MySQL 中使用 INDEX 和 KEY 有什么区别?)

        <tbody id='Miwio'></tbody>

      <legend id='Miwio'><style id='Miwio'><dir id='Miwio'><q id='Miwio'></q></dir></style></legend>
    2. <tfoot id='Miwio'></tfoot>

        • <bdo id='Miwio'></bdo><ul id='Miwio'></ul>

            <i id='Miwio'><tr id='Miwio'><dt id='Miwio'><q id='Miwio'><span id='Miwio'><b id='Miwio'><form id='Miwio'><ins id='Miwio'></ins><ul id='Miwio'></ul><sub id='Miwio'></sub></form><legend id='Miwio'></legend><bdo id='Miwio'><pre id='Miwio'><center id='Miwio'></center></pre></bdo></b><th id='Miwio'></th></span></q></dt></tr></i><div id='Miwio'><tfoot id='Miwio'></tfoot><dl id='Miwio'><fieldset id='Miwio'></fieldset></dl></div>
              • <small id='Miwio'></small><noframes id='Miwio'>

                本文介绍了在 MySQL 中使用 INDEX 和 KEY 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我知道如何在以下代码中使用 INDEX.我知道如何使用外键主键.

                I know how to use INDEX as in the following code. And I know how to use foreign key and primary key.

                CREATE TABLE tasks ( 
                  task_id INT UNSIGNED NOT NULL AUTO_INCREMENT, 
                  parent_id INT UNSIGNED NOT NULL DEFAULT 0, 
                  task VARCHAR(100) NOT NULL, 
                  date_added TIMESTAMP NOT NULL, 
                  date_completed TIMESTAMP, 
                  PRIMARY KEY (task_id), 
                  INDEX parent (parent_id), 
                  ....
                


                但是我发现了一个使用 KEY 而不是 INDEX 的代码,如下所示.


                However I found a code using KEY instead of INDEX as following.

                ...
                KEY order_date (order_date) 
                ...
                


                我在 MySQL 官方页面上找不到任何解释.谁能告诉我 KEY 和 INDEX 之间有什么区别?


                I could not find any explanation on the official MySQL page. Could anyone tell me what is the differences between KEY and INDEX?

                我看到的唯一区别是当我使用KEY ...时,我需要重复这个词,例如
                KEY order_date(order_date).

                The only difference I see is that when I use KEY ..., I need to repeat the word, e.g.
                KEY order_date (order_date).

                推荐答案

                没有区别.它们是同义词.

                There's no difference. They are synonyms.

                来自 CREATE TABLE 手动输入:

                From the CREATE TABLE manual entry:

                KEY 通常是 INDEX 的同义词.键属性 PRIMARY KEY 可以在列定义中给出时,也可以仅指定为 KEY.这是为与其他数据库系统兼容而实施.

                KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition. This was implemented for compatibility with other database systems.

                这篇关于在 MySQL 中使用 INDEX 和 KEY 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)

                <small id='9A6bY'></small><noframes id='9A6bY'>

              • <i id='9A6bY'><tr id='9A6bY'><dt id='9A6bY'><q id='9A6bY'><span id='9A6bY'><b id='9A6bY'><form id='9A6bY'><ins id='9A6bY'></ins><ul id='9A6bY'></ul><sub id='9A6bY'></sub></form><legend id='9A6bY'></legend><bdo id='9A6bY'><pre id='9A6bY'><center id='9A6bY'></center></pre></bdo></b><th id='9A6bY'></th></span></q></dt></tr></i><div id='9A6bY'><tfoot id='9A6bY'></tfoot><dl id='9A6bY'><fieldset id='9A6bY'></fieldset></dl></div>

                <legend id='9A6bY'><style id='9A6bY'><dir id='9A6bY'><q id='9A6bY'></q></dir></style></legend>

                  • <bdo id='9A6bY'></bdo><ul id='9A6bY'></ul>

                    1. <tfoot id='9A6bY'></tfoot>

                          <tbody id='9A6bY'></tbody>