如何使用更新自动数字字段的 mysql 在现有行之间插入新行


How to insert a new row between existing rows using mysql with autonum field updated

MySQL数据库目前列出了旧约的每个希伯来语单词,除了这个希伯来语单词,它在数据库创建过程中未能插入到数据库中(可能存在其他遗漏)。单词输入数据库的顺序很重要,因为目前如何建立句子的顺序也很重要。省略发生在单词 26553 处,这意味着在 26553 处是单词 26554,在 26554 处是单词 26555,依此类推。那么是否有一个SQL语句可以插入记录并将以下AUTONUM字段正确重新定义为正确的数字?如果没有,那么是否有一个功能(即程序)可以遵循以产生所需的结果?

我目前通过 C-Panel_App[phpMyAdmin} 编辑数据库设置

在 phpMyAdmin 4.3.8 文档下 »
要求

网页服务器

由于phpMyAdmin的界面完全基于您的浏览器,因此您需要一个Web服务器(例如Apache,IIS)来安装phpMyAdmin的文件。

.PHP

You need PHP 5.3.0 or newer, with session support, the Standard PHP Library (SPL) extension, JSON support, and the mbstring extension.
To support uploading of ZIP files, you need the PHP zip extension.
You need GD2 support in PHP to display inline thumbnails of JPEGs (“image/jpeg: inline”) with their original aspect ratio.
When using the cookie authentication (the default), the mcrypt extension is strongly suggested.
To support upload progress bars, see 2.9 Seeing an upload progress bar.
To support XML and Open Document Spreadsheet importing, you need the libxml extension.
Performance suggestion: install the ctype extension.

参见

1.31 phpMyAdmin 是否支持 PHP 5?, 使用身份验证模式

数据库

phpMyAdmin 支持 MySQL 兼容数据库。

MySQL 5.5 or newer
MariaDB 5.5 or newer
Drizzle

参见

1.17 phpMyAdmin 支持哪些 MySQL 版本?浏览器

要访问phpMyAdmin,您需要一个启用了cookie和javascript的Web浏览器。


如果您需要更多信息,一些如何获得它的方向会很好,谢谢。使用PHP,MySQL或两者结合的答案将不胜感激。非常感谢。如果需要对数据库进行更改,说明如何通过phpMyAdmin进行更改也将不胜感激。

  1. 首先修改表,使此"id"列不再是主键(您可能需要先删除其自动增量行为)。

  2. 将列的名称更改为类似于 sequence_no

  3. 更新表,以便每sequence_no> = 26553 添加 1。

4,添加新的自动递增PK列,称为id。

  1. 插入缺少的行。将其sequence_no分配为 26553。其 id 将由自动增量器选择。

在查询中,按sequence_no对结果集进行排序。

重复步骤3和5是否有任何进一步的遗漏