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

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

        MySQL 自动增量如何工作?

        时间:2023-07-17
      1. <i id='ItUQ8'><tr id='ItUQ8'><dt id='ItUQ8'><q id='ItUQ8'><span id='ItUQ8'><b id='ItUQ8'><form id='ItUQ8'><ins id='ItUQ8'></ins><ul id='ItUQ8'></ul><sub id='ItUQ8'></sub></form><legend id='ItUQ8'></legend><bdo id='ItUQ8'><pre id='ItUQ8'><center id='ItUQ8'></center></pre></bdo></b><th id='ItUQ8'></th></span></q></dt></tr></i><div id='ItUQ8'><tfoot id='ItUQ8'></tfoot><dl id='ItUQ8'><fieldset id='ItUQ8'></fieldset></dl></div>

        • <small id='ItUQ8'></small><noframes id='ItUQ8'>

            <tfoot id='ItUQ8'></tfoot>

              <legend id='ItUQ8'><style id='ItUQ8'><dir id='ItUQ8'><q id='ItUQ8'></q></dir></style></legend>
                <tbody id='ItUQ8'></tbody>

                • <bdo id='ItUQ8'></bdo><ul id='ItUQ8'></ul>
                  本文介绍了MySQL 自动增量如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我刚刚使用 MySQL 查询浏览器创建了一个新表,并注意到 Auto Increment Column 下有一个勾号.这是如何运作的?

                  I was just creating a new table using MySQL Query Browser, and noticed there's a tick under Auto Increment Column. How does that work?

                  以编程方式添加到数据库时,我是否只添加一个数字,然后数据库自动增加该数字?

                  When adding to the database programatically, do I just add a number, and then the database automatically increments that number?

                  每次有新用户在我的网站上注册时,我都希望他们的客户 ID(仅限整数)自动递增,因此我不必尝试随机生成唯一编号.

                  Everytime a NEW user registers on my site, I want their Customer ID (integer only) to auto increment, so I don't have to try and randomly generate a unique number.

                  这可以简单地完成吗?

                  谢谢!

                  推荐答案

                  以编程方式添加到数据库时,我是否只添加一个数字,然后数据库自动增加该数字?

                  When adding to the database programatically, do I just add a number, and then the database automatically increments that number?

                  是的,这就是 auto_increment 的工作方式.

                  Yes, that's the way auto_increment works.

                  • 每行增加一个值

                  • The value will be incremented for each new row

                  值是唯一的,不可重复

                  如果某行被删除,该行的auto_increment列不会被重新赋值.

                  If a row is deleted, the auto_increment column of that row will not be re-assigned.

                  最后插入行的auto_increment值可以使用mySQL函数LAST_INSERT_ID()访问,但它必须被调用在插入查询之后,在同一个数据库连接中

                  The auto_increment value of the last inserted row can be accessed using the mySQL function LAST_INSERT_ID() but it must be called right after the insert query, in the same database connection

                  mySQL 参考

                  这篇关于MySQL 自动增量如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 SQL Server 数据库中添加 auto_increment 主键? 下一篇:在 mysql 表 auto_increment 中创建一个 ID(事后)

                  相关文章

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

                • <small id='NEbjU'></small><noframes id='NEbjU'>

                • <legend id='NEbjU'><style id='NEbjU'><dir id='NEbjU'><q id='NEbjU'></q></dir></style></legend>
                    <bdo id='NEbjU'></bdo><ul id='NEbjU'></ul>