• <tfoot id='kQpkZ'></tfoot>

    <small id='kQpkZ'></small><noframes id='kQpkZ'>

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

          <bdo id='kQpkZ'></bdo><ul id='kQpkZ'></ul>

        如何在 MySQL 中设置初始值和自动增量?

        时间:2023-08-19

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

          <small id='Epfxj'></small><noframes id='Epfxj'>

            <bdo id='Epfxj'></bdo><ul id='Epfxj'></ul>

                    <tbody id='Epfxj'></tbody>

                1. 本文介绍了如何在 MySQL 中设置初始值和自动增量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  如何为从 1001 开始的 MySQL 表中的id"列设置初始值?

                  How do I set the initial value for an "id" column in a MySQL table that start from 1001?

                  我想做一个插入 "INSERT INTO users (name, email) VALUES ('{$name}', '{$email}')";

                  不指定 id 列的初始值.

                  Without specifying the initial value for the id column.

                  推荐答案

                  使用这个:

                  ALTER TABLE users AUTO_INCREMENT=1001;
                  

                  或者如果您还没有添加 id 列,也添加它

                  or if you haven't already added an id column, also add it

                  ALTER TABLE users ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,
                      ADD INDEX (id);
                  

                  这篇关于如何在 MySQL 中设置初始值和自动增量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:测试 MySQL 表中是否存在行的最佳方法 下一篇:如何在 mySQL 中定义自定义 ORDER BY 订单

                  相关文章

                  最新文章

                      <bdo id='GIRhO'></bdo><ul id='GIRhO'></ul>

                  1. <legend id='GIRhO'><style id='GIRhO'><dir id='GIRhO'><q id='GIRhO'></q></dir></style></legend>

                  2. <tfoot id='GIRhO'></tfoot>

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

                      <small id='GIRhO'></small><noframes id='GIRhO'>